Skip to content

Commit

Permalink
rx51_battery: Fix channel number when reading adc value
Browse files Browse the repository at this point in the history
This issue was introduced in commit 8e2747f "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>
  • Loading branch information
Marek Belisko authored and Anton Vorontsov committed Aug 31, 2013
1 parent da0a00e commit db15e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/rx51_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

/*
Expand Down

0 comments on commit db15e63

Please sign in to comment.