Re: [PATCH] power: bq27xxx_battery: don't update poll_interval param if same

2016-10-18 Thread Sebastian Reichel
Hi,

On Fri, Sep 30, 2016 at 09:45:30PM -0700, Matt Ranostay wrote:
> 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 
> Cc: Sebastian Reichel 
> Signed-off-by: Matt Ranostay 

Thanks, queued to for-next.

-- Sebastian


signature.asc
Description: PGP signature


Re: [PATCH] power: bq27xxx_battery: don't update poll_interval param if same

2016-10-18 Thread Sebastian Reichel
Hi,

On Fri, Sep 30, 2016 at 09:45:30PM -0700, Matt Ranostay wrote:
> 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 
> Cc: Sebastian Reichel 
> Signed-off-by: Matt Ranostay 

Thanks, queued to for-next.

-- Sebastian


signature.asc
Description: PGP signature


[PATCH] power: bq27xxx_battery: don't update poll_interval param if same

2016-09-30 Thread Matt Ranostay
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 
Cc: Sebastian Reichel 
Signed-off-by: Matt Ranostay 
---
 drivers/power/supply/bq27xxx_battery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq27xxx_battery.c 
b/drivers/power/supply/bq27xxx_battery.c
index d18802ca3327..e01cea9a395a 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -404,10 +404,11 @@ static LIST_HEAD(bq27xxx_battery_devices);
 static int poll_interval_param_set(const char *val, const struct kernel_param 
*kp)
 {
struct bq27xxx_device_info *di;
+   unsigned int prev_val = *(unsigned int *) kp->arg;
int ret;
 
ret = param_set_uint(val, kp);
-   if (ret < 0)
+   if (ret < 0 || prev_val == *(unsigned int *) kp->arg)
return ret;
 
mutex_lock(_list_lock);
-- 
2.7.4



[PATCH] power: bq27xxx_battery: don't update poll_interval param if same

2016-09-30 Thread Matt Ranostay
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 
Cc: Sebastian Reichel 
Signed-off-by: Matt Ranostay 
---
 drivers/power/supply/bq27xxx_battery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq27xxx_battery.c 
b/drivers/power/supply/bq27xxx_battery.c
index d18802ca3327..e01cea9a395a 100644
--- a/drivers/power/supply/bq27xxx_battery.c
+++ b/drivers/power/supply/bq27xxx_battery.c
@@ -404,10 +404,11 @@ static LIST_HEAD(bq27xxx_battery_devices);
 static int poll_interval_param_set(const char *val, const struct kernel_param 
*kp)
 {
struct bq27xxx_device_info *di;
+   unsigned int prev_val = *(unsigned int *) kp->arg;
int ret;
 
ret = param_set_uint(val, kp);
-   if (ret < 0)
+   if (ret < 0 || prev_val == *(unsigned int *) kp->arg)
return ret;
 
mutex_lock(_list_lock);
-- 
2.7.4