summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorChris Lapa <chris@lapa.com.au>2017-01-09 01:47:35 +0100
committerSebastian Reichel <sre@kernel.org>2017-01-10 03:45:38 +0100
commite839a448814584e73a79c1fa76caace2ef42e0ee (patch)
tree679912737b0a8eec0a81f2cf656c92502bc30d93 /drivers/power
parentdt-bindings: power: supply: Update TPS65217 properties (diff)
downloadlinux-e839a448814584e73a79c1fa76caace2ef42e0ee.tar.xz
linux-e839a448814584e73a79c1fa76caace2ef42e0ee.zip
power: supply: bq27xxx: move overtemp tests to a switch statement.
This is done for readability as the upcoming commits will add a lot of cases. tested: no Signed-off-by: Chris Lapa <chris@lapa.com.au> Acked-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/bq27xxx_battery.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c
index 08c36b8e04bd..7272d1e024f9 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -674,13 +674,18 @@ static int bq27xxx_battery_read_pwr_avg(struct bq27xxx_device_info *di)
*/
static bool bq27xxx_battery_overtemp(struct bq27xxx_device_info *di, u16 flags)
{
- if (di->chip == BQ27500 || di->chip == BQ27510 ||
- di->chip == BQ27541 || di->chip == BQ27545)
+ switch (di->chip) {
+ case BQ27500:
+ case BQ27510:
+ case BQ27541:
+ case BQ27545:
return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
- if (di->chip == BQ27530 || di->chip == BQ27421)
+ case BQ27530:
+ case BQ27421:
return flags & BQ27XXX_FLAG_OT;
-
- return false;
+ default:
+ return false;
+ }
}
/*