linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: Fix governor_store()
@ 2015-09-21 18:23 Tobias Jakobi
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Jakobi @ 2015-09-21 18:23 UTC (permalink / raw)
  To: linux-pm; +Cc: myungjoo.ham, kyungmin.park, Tobias Jakobi

Writing the currently set governor into sysfs currently
seems to fail.
Fix this by setting the return code to zero before
leaving governor_store().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/devfreq/devfreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 3927ed9..4f1b0ce 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -795,8 +795,10 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
 		ret = PTR_ERR(governor);
 		goto out;
 	}
-	if (df->governor == governor)
+	if (df->governor == governor) {
+		ret = 0;
 		goto out;
+	}
 
 	if (df->governor) {
 		ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
-- 
2.0.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PM / devfreq: Fix governor_store()
@ 2015-09-30  5:06 MyungJoo Ham
  0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2015-09-30  5:06 UTC (permalink / raw)
  To: Tobias Jakobi, linux-pm@vger.kernel.org; +Cc: 박경민

> Writing the currently set governor into sysfs currently
> seems to fail.
> Fix this by setting the return code to zero before
> leaving governor_store().
> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>

Thank you for pointing that out.

Applied.


Cheers,
MyungJoo

> ---
>  drivers/devfreq/devfreq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 3927ed9..4f1b0ce 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -795,8 +795,10 @@ static ssize_t governor_store(struct device *dev, struct device_attribute *attr,
>  		ret = PTR_ERR(governor);
>  		goto out;
>  	}
> -	if (df->governor == governor)
> +	if (df->governor == governor) {
> +		ret = 0;
>  		goto out;
> +	}
>  
>  	if (df->governor) {
>  		ret = df->governor->event_handler(df, DEVFREQ_GOV_STOP, NULL);
> -- 
> 2.0.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-30  5:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30  5:06 [PATCH] PM / devfreq: Fix governor_store() MyungJoo Ham
  -- strict thread matches above, loose matches on Subject: below --
2015-09-21 18:23 Tobias Jakobi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).