led_classdev_register_ext(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’‘ led_classdev_register_ext(9) β€” or, how to birth a brand-new LED bestie ✨

okay so this page lives in the Kernel API Manual, and it's lowkey the origin story of every LED class device you've ever met. it's the _ext version, which means it takes init data and derives the name from it β€” main character energy from the very first line, periodt. πŸŽ€


🌸 SYNOPSIS

int led_classdev_register_ext (struct device *parent , struct
led_classdev *led_cdev , struct led_init_data *init_data );

three arguments, one int coming back at you. that's the whole vibe check. πŸ¦‹


🫢 ARGUMENTS

  • parent β€” the LED controller device that's actually driving this LED. like, the parent, the source of the power, the one who made it all possible πŸ’–
  • led_cdev β€” the led_classdev structure for this device. this is the actual baby being registered, bestie 🌸
  • init_data β€” the LED class device initialization data. this is where the name comes from, so pay attention πŸ‘‘

✨ DESCRIPTION

so what does it do? it registers a new object of the LED class, with the name derived from init_data. that's it, that's the whole thing β€” but ngl that's a pretty iconic job. your brand new LED is officially on the roster πŸ’…

fr fr, init_data is the plug here β€” no init data, no name. don't forget it. πŸ™ˆ

πŸ”₯ RETURN

  • 0 on success πŸŽ‰ slay, you did it
  • a negative error value on failure πŸ’€ it's giving "not today"

πŸ’œ SEE ALSO

okay this is the friend group, and honestly they're all iconic in their own way. all of these live in the kernel file ./include/linux/leds.h:

go read them all, iykyk πŸ‘‘πŸŒˆ


quick reminder bestie: the name comes from init_data, so if your LED ends up with a cursed name, that's where you look. not me, not the kernel, not the vibes. πŸ“

and that's the whole page, mwah πŸ’‹ this little gem ships from ./include/linux, dated October 2026, and it's page led_classdev_register_ext(9) of the Kernel API Manual β€” go register something iconic, bestie, you've got this πŸ§šβ­πŸ’–

πŸ“¦ where this page comes from