mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 01:08:50 +00:00
rx51_battery: Fix channel number when reading adc value
This issue was introduced in commit 8e2747f031bd "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> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
This commit is contained in:
parent
da0a00ebc2
commit
db15e6312e
@ -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];
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user