Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: rt9467: Fix rt9467_run_aicl()

It is spurious to bail-out on a wait_for_completion_timeout() call that
does NOT timeout.

Reverse the logic to return -ETIMEDOUT instead, in case of tiemout.

Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/2ed01020fa8a135c36dbaa871095ded47d926507.1676464968.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Christophe JAILLET and committed by
Sebastian Reichel
cba32040 cbcdfbf5

+2 -2
+2 -2
drivers/power/supply/rt9467-charger.c
··· 598 598 599 599 reinit_completion(&data->aicl_done); 600 600 ret = wait_for_completion_timeout(&data->aicl_done, msecs_to_jiffies(3500)); 601 - if (ret) 602 - return ret; 601 + if (ret == 0) 602 + return -ETIMEDOUT; 603 603 604 604 ret = rt9467_get_value_from_ranges(data, F_IAICR, RT9467_RANGE_IAICR, &aicr_get); 605 605 if (ret) {