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>
This commit is contained in:
parent
7cbad9fa5f
commit
e839a44881
|
@ -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)
|
static bool bq27xxx_battery_overtemp(struct bq27xxx_device_info *di, u16 flags)
|
||||||
{
|
{
|
||||||
if (di->chip == BQ27500 || di->chip == BQ27510 ||
|
switch (di->chip) {
|
||||||
di->chip == BQ27541 || di->chip == BQ27545)
|
case BQ27500:
|
||||||
|
case BQ27510:
|
||||||
|
case BQ27541:
|
||||||
|
case BQ27545:
|
||||||
return flags & (BQ27XXX_FLAG_OTC | BQ27XXX_FLAG_OTD);
|
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 flags & BQ27XXX_FLAG_OT;
|
||||||
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue