ubi_major2num(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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