summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-07-17 07:18:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-21 13:43:20 +0200
commit41dfd908fc09e0e57f8f44fdcf543348cd5f249c (patch)
tree0f5238edcdacf273abdc17ed676c818fddd36cdd /drivers/cpufreq
parentcpufreq: don't restore policy->cpus on failure to move kobj (diff)
downloadlinux-41dfd908fc09e0e57f8f44fdcf543348cd5f249c.tar.xz
linux-41dfd908fc09e0e57f8f44fdcf543348cd5f249c.zip
cpufreq: propagate error returned by kobject_move()
We are returning -EINVAL instead of the error returned from kobject_move() when it fails. Propagate the actual error number. Also add a meaningful print when sysfs_create_link() fails. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index e572d51db945..ec25ca607679 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1322,10 +1322,12 @@ static int cpufreq_nominate_new_policy_cpu(struct cpufreq_policy *policy,
ret = kobject_move(&policy->kobj, &cpu_dev->kobj);
if (ret) {
pr_err("%s: Failed to move kobj: %d\n", __func__, ret);
- ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj,
- "cpufreq");
- return -EINVAL;
+ if (sysfs_create_link(&cpu_dev->kobj, &policy->kobj, "cpufreq"))
+ pr_err("%s: Failed to restore kobj link to cpu:%d\n",
+ __func__, cpu_dev->id);
+
+ return ret;
}
return cpu_dev->id;