提交 950b6c2d 编写于 作者: M Matt Ranostay 提交者: Sebastian Reichel

power: supply: bq27xxx_battery: don't update poll_interval param if same

To avoid canceling the delayed workqueue needlessly, and scheduling an
immediate polling. Check if the new poll_interval value is different
than the previous setting.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: NMatt Ranostay <matt@ranostay.consulting>
Signed-off-by: NSebastian Reichel <sre@kernel.org>
上级 32c52eff
...@@ -397,10 +397,11 @@ static LIST_HEAD(bq27xxx_battery_devices); ...@@ -397,10 +397,11 @@ static LIST_HEAD(bq27xxx_battery_devices);
static int poll_interval_param_set(const char *val, const struct kernel_param *kp) static int poll_interval_param_set(const char *val, const struct kernel_param *kp)
{ {
struct bq27xxx_device_info *di; struct bq27xxx_device_info *di;
unsigned int prev_val = *(unsigned int *) kp->arg;
int ret; int ret;
ret = param_set_uint(val, kp); ret = param_set_uint(val, kp);
if (ret < 0) if (ret < 0 || prev_val == *(unsigned int *) kp->arg)
return ret; return ret;
mutex_lock(&bq27xxx_list_lock); mutex_lock(&bq27xxx_list_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册