continue;
pr_debug("Adding link for CPU: %u\n", j);
- cpufreq_cpu_get(policy->cpu);
cpu_dev = get_cpu_device(j);
ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj,
"cpufreq");
- if (ret) {
- cpufreq_cpu_put(policy);
- return ret;
- }
+ if (ret)
+ break;
}
return ret;
}
unsigned long flags;
policy = cpufreq_cpu_get(sibling);
- WARN_ON(!policy);
+ if (WARN_ON_ONCE(!policy))
+ return -ENODATA;
if (has_target)
__cpufreq_governor(policy, CPUFREQ_GOV_STOP);
}
/* Don't touch sysfs links during light-weight init */
- if (frozen) {
- /* Drop the extra refcount that we took above */
- cpufreq_cpu_put(policy);
- return 0;
- }
-
- ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
- if (ret)
- cpufreq_cpu_put(policy);
+ if (!frozen)
+ ret = sysfs_create_link(&dev->kobj, &policy->kobj, "cpufreq");
+ cpufreq_cpu_put(policy);
return ret;
}
#endif
if (!frozen)
cpufreq_policy_free(data);
} else {
-
- if (!frozen) {
- pr_debug("%s: removing link, cpu: %d\n", __func__, cpu);
- cpufreq_cpu_put(data);
- }
-
if (cpufreq_driver->target) {
__cpufreq_governor(data, CPUFREQ_GOV_START);
__cpufreq_governor(data, CPUFREQ_GOV_LIMITS);