diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 845687884c1e..bbd5c2164ab6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -756,7 +756,12 @@ static struct kobj_type ktype_cpufreq = { | |||
756 | .release = cpufreq_sysfs_release, | 756 | .release = cpufreq_sysfs_release, |
757 | }; | 757 | }; |
758 | 758 | ||
759 | 759 | /* | |
760 | * Returns: | ||
761 | * Negative: Failure | ||
762 | * 0: Success | ||
763 | * Positive: When we have a managed CPU and the sysfs got symlinked | ||
764 | */ | ||
760 | int cpufreq_add_dev_policy(unsigned int cpu, struct cpufreq_policy *policy, | 765 | int cpufreq_add_dev_policy(unsigned int cpu, struct cpufreq_policy *policy, |
761 | struct sys_device *sys_dev) | 766 | struct sys_device *sys_dev) |
762 | { | 767 | { |
@@ -817,7 +822,11 @@ int cpufreq_add_dev_policy(unsigned int cpu, struct cpufreq_policy *policy, | |||
817 | */ | 822 | */ |
818 | if (cpufreq_driver->exit) | 823 | if (cpufreq_driver->exit) |
819 | cpufreq_driver->exit(policy); | 824 | cpufreq_driver->exit(policy); |
820 | return ret; | 825 | |
826 | if (!ret) | ||
827 | return 1; | ||
828 | else | ||
829 | return ret; | ||
821 | } | 830 | } |
822 | } | 831 | } |
823 | #endif | 832 | #endif |
@@ -1001,8 +1010,13 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
1001 | CPUFREQ_START, policy); | 1010 | CPUFREQ_START, policy); |
1002 | 1011 | ||
1003 | ret = cpufreq_add_dev_policy(cpu, policy, sys_dev); | 1012 | ret = cpufreq_add_dev_policy(cpu, policy, sys_dev); |
1004 | if (ret) | 1013 | if (ret) { |
1014 | if (ret > 0) | ||
1015 | /* This is a managed cpu, symlink created, | ||
1016 | exit with 0 */ | ||
1017 | ret = 0; | ||
1005 | goto err_unlock_policy; | 1018 | goto err_unlock_policy; |
1019 | } | ||
1006 | 1020 | ||
1007 | ret = cpufreq_add_dev_interface(cpu, policy, sys_dev); | 1021 | ret = cpufreq_add_dev_interface(cpu, policy, sys_dev); |
1008 | if (ret) | 1022 | if (ret) |