Thread (18 messages) 18 messages, 6 authors, 2026-01-14

Re: [PATCH v6 2/4] backlight: add max25014atg backlight

From: Daniel Thompson <danielt@kernel.org>
Date: 2026-01-14 16:29:51
Also in: dri-devel, imx, linux-devicetree, linux-fbdev, linux-leds, lkml

On Fri, Jan 09, 2026 at 09:55:18AM +0100, Maud Spierings wrote:
Do you have any comments about:
quoted
+static void max25014_remove(struct i2c_client *cl)
+{
+	struct max25014 *maxim = i2c_get_clientdata(cl);
+
+	maxim->bl->props.brightness = 0;
+	max25014_update_status(maxim->bl);
+	gpiod_set_value_cansleep(maxim->enable, 0);
+	regulator_disable(maxim->vin);
+}
I'm feeling like the setting of the brightness + update status maybe should
be a call to backlight_device_set_brightness() or maybe it shouldn't really
be there at all?
Using backlight_device_set_brightness() makes sense (although there is
still a window where userspace could come back in and turn the backlight
on again). And, if both the GPIO and regulator were optional then it is
sensible to set the brightness to zero before removing the driver.


Daniel.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help