]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
power: supply: bq24190_charger: Longer delay while polling reset flag
authorLiam Breck <kernel@networkimprov.net>
Tue, 11 Apr 2017 11:59:57 +0000 (04:59 -0700)
committerSebastian Reichel <sre@kernel.org>
Thu, 13 Apr 2017 23:41:35 +0000 (01:41 +0200)
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 <kernel@networkimprov.net>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/bq24190_charger.c

index 13b22e4a80cd5d7462b0d96f176bc43b514f6cac..7c893c00fa053b11739658d5c951f4f005ed4fe8 100644 (file)
@@ -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 */