devm_of_find_backlight(9)
π devm_of_find_backlight(9) π
okay so bestie, welcome to the Kernel API Manual β this one's a little function page called devm_of_find_backlight, and honestly? she's a whole vibe. let's get into it π
β¨ SYNOPSIS β¨
struct backlight_device * devm_of_find_backlight (struct device *dev );
yeah that's it. one arg, one return, no drama π
πΈ ARGUMENTS πΈ
devβ the device. that's the whole description, she's lowkey mysterious like that π¦
π DESCRIPTION π
so what does she even do? okay so: this function goes looking for a property named backlight on the DT node that's connected to dev, and then it looks up the backlight device for you. easy β¨
and here's the iconic part β the lookup is device managed, which means the reference to the backlight device gets dropped automatically on driver detach. no manual cleanup, no put calls, nothing. she handles it. main character energy fr fr π₯
now, the returns, listen up:
- a pointer to the backlight device, if it's found π«Ά
- an error pointer
-EPROBE_DEFERif the DT property is set, but no backlight device gets found π NULLif there's just nobacklightproperty at all π
ngl, that -EPROBE_DEFER case is the sneaky one β property's there, device isn't, and you get an error pointer, not NULL. don't mix them up bestie π
π¦ SEE ALSO π¦
go read these next, i'm obsessed with all of them:
- the kernel file
./drivers/video/backlight/backlight.c overview(9)backlight_force_update(9)backlight_device_get_by_name(9)devm_backlight_device_register(9)devm_backlight_device_unregister(9)of_find_backlight_by_node(9)
and that's the page!! no cap, you got this ππ
sign-off szn: this one comes to you from ./drivers/video/backlight, dated October 2026 β mwah, go forth and find those backlights π§βπ
π¦ 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