ubi_get_device_info(9)
β¨ ubi_get_device_info β¨
okay so this is a page from the Kernel API Manual β section 9, kernel API, bestie. it's about ubi_get_device_info, and yeah it's basically the "hey what's up with this UBI device" function. let's get into it π
πΈ NAME πΈ
ubi_get_device_info β get information about UBI device.
like, the whole vibe is: you got a UBI device, you wanna know stuff about it, this is the girl for the job π
π¦ SYNOPSIS π¦
int ubi_get_device_info (int ubi_num , struct ubi_device_info *di );
ok so she takes ubi_num and di, returns an int, and that's literally it. no cap, that's the whole signature π«Ά
π ARGUMENTS π
ubi_numβ UBI device number. you're like "which one tho" and this is the answer π¦diβ the information is stored here. this is where the tea gets poured, bestie. the info goes in here, so it has to be astruct ubi_device_info *. π
π DESCRIPTION π
so here's the situation: this function returns 0 in case of success β iconic, we love a clean zero π β and it returns -EINVAL if the UBI device number is invalid (like, girl, that number is not it π), and -ENODEV if there is no such UBI device (the device said "not me" and vanished π).
so basically:
- it works?
0. slay. periodt. β - bad device number?
-EINVAL. π© - no such device?
-ENODEV. rip. π
lowkey important: these three return values are the whole story β0,-EINVAL,-ENODEV. don't go inventing extra ones, i'm not gonna let you set yourself up like that π«Ά
π§ SEE ALSO π§
like, go read these next, fr fr β the kernel file ./drivers/mtd/ubi/kapi.c is the main character here π and then we got the whole friend group:
ubi_do_get_device_info(9)ubi_do_get_volume_info(9)ubi_get_volume_info(9)ubi_open_volume(9)ubi_open_volume_nm(9)ubi_get_num_by_path(9)ubi_open_volume_path(9)ubi_close_volume(9)leb_read_sanity_check(9)ubi_leb_read(9)ubi_leb_read_sg(9)ubi_leb_write(9)ubi_leb_erase(9)ubi_leb_unmap(9)ubi_leb_map(9)ubi_is_mapped(9)ubi_sync(9)ubi_register_volume_notifier(9)ubi_unregister_volume_notifier(9)
literally a whole squad. iykyk π¦
and that's the page bestie!! π this one came from ./drivers/mtd/ubi, dated October 2026, and she's living her best life in the Kernel API Manual (section 9). go get that device info, you absolute icon πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms