Commit 52bef41f authored by Ikjoon Jang's avatar Ikjoon Jang Committed by Sebastian Reichel

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: default avatarIkjoon Jang <ikjn@chromium.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent be2919d8
...@@ -193,7 +193,6 @@ struct sbs_info { ...@@ -193,7 +193,6 @@ struct sbs_info {
struct power_supply *power_supply; struct power_supply *power_supply;
bool is_present; bool is_present;
struct gpio_desc *gpio_detect; struct gpio_desc *gpio_detect;
bool enable_detection;
bool charger_broadcasts; bool charger_broadcasts;
int last_state; int last_state;
int poll_time; int poll_time;
...@@ -961,9 +960,6 @@ static int sbs_get_property(struct power_supply *psy, ...@@ -961,9 +960,6 @@ static int sbs_get_property(struct power_supply *psy,
return -EINVAL; return -EINVAL;
} }
if (!chip->enable_detection)
goto done;
if (!chip->gpio_detect && if (!chip->gpio_detect &&
chip->is_present != (ret >= 0)) { chip->is_present != (ret >= 0)) {
sbs_update_presence(chip, (ret >= 0)); sbs_update_presence(chip, (ret >= 0));
...@@ -1092,7 +1088,6 @@ static int sbs_probe(struct i2c_client *client) ...@@ -1092,7 +1088,6 @@ static int sbs_probe(struct i2c_client *client)
chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev);
chip->client = client; chip->client = client;
chip->enable_detection = false;
psy_cfg.of_node = client->dev.of_node; psy_cfg.of_node = client->dev.of_node;
psy_cfg.drv_data = chip; psy_cfg.drv_data = chip;
chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN; chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
...@@ -1162,6 +1157,8 @@ static int sbs_probe(struct i2c_client *client) ...@@ -1162,6 +1157,8 @@ static int sbs_probe(struct i2c_client *client)
} }
} }
INIT_DELAYED_WORK(&chip->work, sbs_delayed_work);
chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc, chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc,
&psy_cfg); &psy_cfg);
if (IS_ERR(chip->power_supply)) { if (IS_ERR(chip->power_supply)) {
...@@ -1174,10 +1171,6 @@ static int sbs_probe(struct i2c_client *client) ...@@ -1174,10 +1171,6 @@ static int sbs_probe(struct i2c_client *client)
dev_info(&client->dev, dev_info(&client->dev,
"%s: battery gas gauge device registered\n", client->name); "%s: battery gas gauge device registered\n", client->name);
INIT_DELAYED_WORK(&chip->work, sbs_delayed_work);
chip->enable_detection = true;
return 0; return 0;
exit_psupply: exit_psupply:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment