led_classdev_register_ext(9)
π‘ 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β theled_classdevstructure 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
0on 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:
struct led_lookup_data(9)led_classdev_register(9)led_blink_set(9)led_blink_set_nosleep(9)led_blink_set_oneshot(9)led_set_brightness(9)led_set_brightness_sync(9)led_mc_set_brightness(9)led_update_brightness(9)led_get_default_pattern(9)led_sysfs_disable(9)led_sysfs_enable(9)led_compose_name(9)led_get_color_name(9)led_sysfs_is_disabled(9)struct led_pattern(9)
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
- 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