lkml.org 
[lkml]   [2013]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] power: rx51_battery: Replace hardcoded channels values.
> This issue was introduced in commit:
> power: rx51_battery: Replace hardcoded channels values.
>
> Original code use channel as argument which was shifted by one in function.
> After mentioned commit argument is already shifted so we need to get index
> back.
>
> Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>

Applied, thanks!

> ---
> drivers/power/rx51_battery.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
> index 03f5761..1bc5857 100644
> --- a/drivers/power/rx51_battery.c
> +++ b/drivers/power/rx51_battery.c
> @@ -51,7 +51,7 @@ static int rx51_battery_read_adc(int channel)
> if (twl4030_madc_conversion(&req) <= 0)
> return -ENODATA;
>
> - return req.rbuf[channel];
> + return req.rbuf[ffs(channel) - 1];
> }
>
> /*


\
 
 \ /
  Last update: 2013-08-31 04:01    [W:1.782 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site