led_get(9)
π led_get(9) β the one where you ask the LED framework for a lil light π‘
okay so bestie, welcome to the Kernel API Manual β¨ this is the page for led_get, and ngl it's short but it matters β it's literally how you get your hands on a LED device through the LED subsystem. let's go π«Ά
πΈ SYNOPSIS πΈ
struct led_classdev * led_get (struct device *dev , char *con_id );
that's it. that's the whole vibe. two args in, one pointer out. slay π
π ARGUMENTS π
devβ the device you're asking for the LED device. it's the device you're getting the LED from, from its point of view. like "hey, this device, give me its LED" π₯con_idβ the name of the LED, but as the device sees it π this is the connection ID, i.e. the LED's name from the device's point of view. no cap, the naming perspective matters here.
π¦ DESCRIPTION π¦
so what does it actually do? it returns a pointer to a LED device β¨ or, if things go sideways, it returns ERR_PTR(errno) on failure π β and yes, that's the classic kernel-style "the return value is an error pointer, please check it with IS_ERR()" situation, not a NULL. so check your pointers, bestie, fr fr π
β οΈ heads up: the failure return isERR_PTR(errno), notNULL. treat that pointer with the respect it deserves before you dereference it π
π SEE ALSO π
the kernel file that lives at ./drivers/leds/led-class.c π and honestly the whole LED-framework friend group:
led_classdev_suspend(9)led_classdev_resume(9)fwnode_led_get(9)led_put(9)devm_of_led_get(9)devm_led_get(9)led_add_lookup(9)led_remove_lookup(9)devm_of_led_get_optional(9)led_classdev_register_ext(9)led_classdev_unregister(9)devm_led_classdev_register_ext(9)devm_led_classdev_unregister(9)
like, the whole squad π go read them, iykyk π§
and that's the page, bestie π this lil gem comes to you from the Kernel API Manual, source ./drivers/leds, dated October 2026 β mwah, go light something up πβ¨
π¦ 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