Skip to contentSkip to conversation

PM / devfreq: Fix governor_store()

PATCH MyungJoo Ham 1 participant 1 message Sep 30, 2015

lore
Share & tools
lore

MyungJoo Ham

author Applied
#0 lore raw
Quoted 6 lines

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

Thank you for pointing that out.

Applied.

Cheers,
MyungJoo

Quoted 22 lines
---
 drivers/devfreq/devfreq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/devfreq/devfreq.c +3 -1
index 3927ed9..4f1b0ce 100644
@@ -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);
Signature · 1 line
2.0.5