]> www.infradead.org Git - users/willy/xarray.git/commit
power: supply: ab8500: Fix error handling when calling iio_read_channel_processed()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 22 Jun 2024 07:04:24 +0000 (09:04 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 26 Jun 2024 13:00:53 +0000 (15:00 +0200)
commit3288757087cbb93b91019ba6b7de53a1908c9d48
treef424032da85bc3a616b42206e6ed08d91556e800
parentad175de1f8da6043553dec4402fc1ff28494ac7b
power: supply: ab8500: Fix error handling when calling iio_read_channel_processed()

The ab8500_charger_get_[ac|vbus]_[current|voltage]() functions should
return an error code on error.

Up to now, an un-initialized value is returned.
This makes the error handling of the callers un-reliable.

Return the error code instead, to fix the issue.

Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/f9f65642331c9e40aaebb888589db043db80b7eb.1719037737.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500_charger.c