diff options
author | Pavel Machek <pavel@ucw.cz> | 2017-12-27 10:20:42 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.co.uk> | 2018-01-08 18:40:06 +0100 |
commit | 31381042a614034386abb7fe7efeef392563e3b2 (patch) | |
tree | 22213a306393d0b0027881e7942c64b2afda6bb8 /drivers/power/supply | |
parent | 331645e165a9b40b49d9cb495bb5ea37850b57a7 (diff) |
bq24190: Simplify code in property_is_writeable
Simplify function that should be trivial.
Signed-off-by: Pavel machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power/supply')
-rw-r--r-- | drivers/power/supply/bq24190_charger.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c index c4335ff70232..b58df04d03b3 100644 --- a/drivers/power/supply/bq24190_charger.c +++ b/drivers/power/supply/bq24190_charger.c @@ -1199,8 +1199,6 @@ 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: @@ -1208,13 +1206,10 @@ static int bq24190_charger_property_is_writeable(struct power_supply *psy, 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) |