diff options
author | Ikjoon Jang <ikjn@chromium.org> | 2020-08-11 07:41:41 +0300 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-08-28 00:54:58 +0300 |
commit | 52bef41f606b036541f71f529819e5889ab1bbeb (patch) | |
tree | 9129c0905bcf4720066b5af559ad0b77b11a3286 | |
parent | be2919d8355e4651386ad2fb61ddb6efe4533b1b (diff) | |
download | linux-52bef41f606b036541f71f529819e5889ab1bbeb.tar.xz |
power: supply: sbs-battery: remove unused enable_detection flags
Remove unused enable_detection flag which is always true after
the device is proved.
Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r-- | drivers/power/supply/sbs-battery.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index 49c3508a6b79..5dfb87291c52 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -193,7 +193,6 @@ struct sbs_info { struct power_supply *power_supply; bool is_present; struct gpio_desc *gpio_detect; - bool enable_detection; bool charger_broadcasts; int last_state; int poll_time; @@ -961,9 +960,6 @@ static int sbs_get_property(struct power_supply *psy, return -EINVAL; } - if (!chip->enable_detection) - goto done; - if (!chip->gpio_detect && chip->is_present != (ret >= 0)) { sbs_update_presence(chip, (ret >= 0)); @@ -1092,7 +1088,6 @@ static int sbs_probe(struct i2c_client *client) chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); chip->client = client; - chip->enable_detection = false; psy_cfg.of_node = client->dev.of_node; psy_cfg.drv_data = chip; chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN; @@ -1162,6 +1157,8 @@ skip_gpio: } } + INIT_DELAYED_WORK(&chip->work, sbs_delayed_work); + chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc, &psy_cfg); if (IS_ERR(chip->power_supply)) { @@ -1174,10 +1171,6 @@ skip_gpio: dev_info(&client->dev, "%s: battery gas gauge device registered\n", client->name); - INIT_DELAYED_WORK(&chip->work, sbs_delayed_work); - - chip->enable_detection = true; - return 0; exit_psupply: |