cpufreq: remove extra parenthesis
[cascardo/linux.git] / drivers / cpufreq / cpufreq.c
index 46bed4f..a180bb4 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/mutex.h>
 #include <linux/slab.h>
 #include <linux/suspend.h>
+#include <linux/syscore_ops.h>
 #include <linux/tick.h>
 #include <trace/events/power.h>
 
@@ -902,7 +903,7 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
 
        /* set up files for this cpu device */
        drv_attr = cpufreq_driver->attr;
-       while ((drv_attr) && (*drv_attr)) {
+       while (drv_attr && *drv_attr) {
                ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
                if (ret)
                        return ret;
@@ -2006,10 +2007,6 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
 }
 EXPORT_SYMBOL_GPL(cpufreq_driver_target);
 
-/*
- * when "event" is CPUFREQ_GOV_LIMITS
- */
-
 static int __cpufreq_governor(struct cpufreq_policy *policy,
                                        unsigned int event)
 {
@@ -2556,6 +2553,14 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver)
 }
 EXPORT_SYMBOL_GPL(cpufreq_unregister_driver);
 
+/*
+ * Stop cpufreq at shutdown to make sure it isn't holding any locks
+ * or mutexes when secondary CPUs are halted.
+ */
+static struct syscore_ops cpufreq_syscore_ops = {
+       .shutdown = cpufreq_suspend,
+};
+
 static int __init cpufreq_core_init(void)
 {
        if (cpufreq_disabled())
@@ -2564,6 +2569,8 @@ static int __init cpufreq_core_init(void)
        cpufreq_global_kobject = kobject_create();
        BUG_ON(!cpufreq_global_kobject);
 
+       register_syscore_ops(&cpufreq_syscore_ops);
+
        return 0;
 }
 core_initcall(cpufreq_core_init);