Commit 1a37a039 authored by Dinghao Liu's avatar Dinghao Liu Committed by Sebastian Reichel

power: supply: bq24190_charger: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.
Signed-off-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 7222bd60
...@@ -481,8 +481,10 @@ static ssize_t bq24190_sysfs_store(struct device *dev, ...@@ -481,8 +481,10 @@ static ssize_t bq24190_sysfs_store(struct device *dev,
return ret; return ret;
ret = pm_runtime_get_sync(bdi->dev); ret = pm_runtime_get_sync(bdi->dev);
if (ret < 0) if (ret < 0) {
pm_runtime_put_noidle(bdi->dev);
return ret; return ret;
}
ret = bq24190_write_mask(bdi, info->reg, info->mask, info->shift, v); ret = bq24190_write_mask(bdi, info->reg, info->mask, info->shift, v);
if (ret) if (ret)
......
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