led_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 is ERR_PTR(errno), not NULL. 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:

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