ubi_major2num(9)
π ubi_major2num β a kernel API moment (manual section 9)
okay so bestie, you're in the Kernel API Manual and today's main character is ubi_major2num(9). yes it's a whole vibe. let's get into it β¨
πΈ NAME πΈ
ubi_major2num β get the UBI device number by character device major number. literally that's the whole gig π
β SYNOPSIS β
int ubi_major2num (int major );
no cap, that's the signature. keep it exactly like that π«Ά
π¦ ARGUMENTS π¦
majorβ the major number. that's it. that's the argument. it's giving simple and iconic π
π DESCRIPTION π
so what does it do? this function searches for the UBI device number object by its major number, bestie π iykyk
if the UBI device was not found, this function returns -ENODEV π otherwise, the UBI device number is returned β¨ slay.
lowkey important: -ENODEV means "no device, bestie, it's not here." don't be surprised when you get it π
π₯ SEE ALSO π₯
the whole friend group, fr fr β starting with the kernel file:
- Kernel file
./drivers/mtd/ubi/build.candstruct mtd_dev_param(9) ubi_volume_notify(9)ubi_notify_all(9)ubi_enumerate_volumes(9)ubi_get_device(9)ubi_put_device(9)ubi_get_by_major(9)kill_volumes(9)uif_init(9)uif_close(9)ubi_free_volumes_from(9)ubi_free_all_volumes(9)ubi_free_internal_volumes(9)io_init(9)autoresize(9)ubi_attach_mtd_dev(9)ubi_detach_mtd_dev(9)open_mtd_by_chdev(9)open_mtd_device(9)bytes_str_to_int(9)ubi_mtd_param_parse(9)
go read them all, they're all iconic, periodt π
sign-off time π§ this page lives in ./drivers/mtd/ubi, dated October 2026 β and the whole thing is titled ubi_major2num(9) in case you forgot already π byeee π
π¦ 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