From: Liam Breck Date: Tue, 11 Apr 2017 11:59:57 +0000 (-0700) Subject: power: supply: bq24190_charger: Longer delay while polling reset flag X-Git-Tag: v4.12-rc1~172^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=61489b0f9fa835cd2fef67ae26790cdf64b6b1c7;p=karo-tx-linux.git power: supply: bq24190_charger: Longer delay while polling reset flag On chip reset, polling loop used udelay(10) which is too short to be useful. Instead, use usleep_range(100, 200). Signed-off-by: Liam Breck Acked-by: Tony Lindgren Acked-by: Hans de Goede Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c index 13b22e4a80cd..7c893c00fa05 100644 --- a/drivers/power/supply/bq24190_charger.c +++ b/drivers/power/supply/bq24190_charger.c @@ -550,16 +550,13 @@ static int bq24190_register_reset(struct bq24190_dev_info *bdi) if (ret < 0) return ret; - if (!v) - break; + if (v == 0) + return 0; - udelay(10); + usleep_range(100, 200); } while (--limit); - if (!limit) - return -EIO; - - return 0; + return -EIO; } /* Charger power supply property routines */