Re: [PATCH 2/2 v2] pwm_bl: Add mandatory backlight enable regulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 13, 2013 at 09:56:57AM +0100, Peter Ujfalusi wrote:
> On 03/12/2013 11:22 PM, Andrew Chew wrote:
[...]
> > +static void pwm_backlight_disable(struct backlight_device *bl)
> > +{
> > +	struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev);
> > +
> > +	/* Bail if we are already disabled. */
> > +	if (!pb->enabled)
> > +		return;
> > +
> > +	if (regulator_disable(pb->enable_supply) != 0)
> > +		dev_warn(&bl->dev, "Failed to disable regulator");
> > +
> > +	pwm_disable(pb->pwm);
> > +
> > +	pb->enabled = false;
> > +}
> 
> Would it not be better to have some locking here since the code started to use
> flag for state tracking?

I don't think that's necessary. The backlight core already uses the
ops_lock mutex to serial accesses. I just noticed that the documentation
mentions that update_lock is used for this purpose, but the code doesn't
use it after it is initialized. Still, the ops_lock should be enough.

Thierry

Attachment: pgpfF4YgGqfDa.pgp
Description: PGP signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux