[PATCH v6 2/4] backlight: add max25014atg backlight
Daniel Thompson
danielt at kernel.org
Wed Jan 14 08:29:44 PST 2026
On Fri, Jan 09, 2026 at 09:55:18AM +0100, Maud Spierings wrote:
> Do you have any comments about:
>
> > +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.
More information about the linux-arm-kernel
mailing list