Skip to content

Commit cba3204

Browse files
tititiou36sre
authored andcommitted
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: 6f7f70e ("power: supply: rt9467: Add Richtek RT9467 charger driver") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: ChiYuan Huang <[email protected]> Link: https://lore.kernel.org/r/2ed01020fa8a135c36dbaa871095ded47d926507.1676464968.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sebastian Reichel <[email protected]>
1 parent cbcdfbf commit cba3204

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/power/supply/rt9467-charger.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,8 @@ static int rt9467_run_aicl(struct rt9467_chg_data *data)
598598

599599
reinit_completion(&data->aicl_done);
600600
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;
603603

604604
ret = rt9467_get_value_from_ranges(data, F_IAICR, RT9467_RANGE_IAICR, &aicr_get);
605605
if (ret) {

0 commit comments

Comments
 (0)