Hello.

On Sat, 2012-04-21 at 08:30, benjamin deering wrote:
> From: benjamin Deering <ben_deer...@swissmail.org>
> 
> Protect calls in bq27x00_external_power_changed with the mutex that
> is used to protect the same calls in other places in the driver.
> ---
>  drivers/power/bq27x00_battery.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
> index 59e68db..325b006 100644
> --- a/drivers/power/bq27x00_battery.c
> +++ b/drivers/power/bq27x00_battery.c
> @@ -512,9 +512,10 @@ static int bq27x00_battery_get_property(struct 
> power_supply *psy,
>  static void bq27x00_external_power_changed(struct power_supply *psy)
>  {
>       struct bq27x00_device_info *di = to_bq27x00_device_info(psy);
> -
> +     mutex_lock(&di->lock);
>       cancel_delayed_work_sync(&di->work);
>       schedule_delayed_work(&di->work, 0);
> +     mutex_lock(&di->unlock);

Maybe I'm totally off here but os one not supposed to use with with
mutex_lock()/mutex_unlock(). And at least in the mainline version of
this driver I could not find a member called unlock in struct
bq27x00_device_info.

Maybe you just replaced the lock with unlock in the variable and not
the function name? That would raise the question if this was tested
at all though. ;)

regards
Stefan Schmidt
_______________________________________________
Shr-devel mailing list
Shr-devel@lists.shr-project.org
http://lists.shr-project.org/mailman/listinfo/shr-devel

Reply via email to