Skip to content

Commit

Permalink
bq24190: Simplify code in property_is_writeable
Browse files Browse the repository at this point in the history
Simplify function that should be trivial.

Signed-off-by: Pavel machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
  • Loading branch information
Pavel Machek authored and Sebastian Reichel committed Jan 8, 2018
1 parent 331645e commit 3138104
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/power/supply/bq24190_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,22 +1199,17 @@ static int bq24190_charger_set_property(struct power_supply *psy,
static int bq24190_charger_property_is_writeable(struct power_supply *psy,
enum power_supply_property psp)
{
int ret;

switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
case POWER_SUPPLY_PROP_TEMP_ALERT_MAX:
case POWER_SUPPLY_PROP_CHARGE_TYPE:
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT:
ret = 1;
break;
return 1;
default:
ret = 0;
return 0;
}

return ret;
}

static void bq24190_input_current_limit_work(struct work_struct *work)
Expand Down

0 comments on commit 3138104

Please sign in to comment.