[PATCH] misc duplicate field initializers
[sfrench/cifs-2.6.git] / drivers / macintosh / windfarm_pm112.c
index c2a4e689c784e776fca5968561d6da4d23e0935a..b3fbb45bc90acbdd586d790140dee5b063690476 100644 (file)
@@ -358,6 +358,7 @@ static void backside_fan_tick(void)
                return;
        if (!backside_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Backside control loop started.\n");
                backside_param.min = backside_fan->ops->get_min(backside_fan);
                backside_param.max = backside_fan->ops->get_max(backside_fan);
                wf_pid_init(&backside_pid, &backside_param);
@@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void)
                return;
        if (!drive_bay_tick) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Drive bay control loop started.\n");
                drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan);
                drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan);
                wf_pid_init(&drive_bay_pid, &drive_bay_prm);
@@ -458,6 +460,7 @@ static void slots_fan_tick(void)
                return;
        if (!slots_started) {
                /* first time; initialize things */
+               printk(KERN_INFO "windfarm: Slots control loop started.\n");
                wf_pid_init(&slots_pid, &slots_param);
                slots_started = 1;
        }
@@ -504,6 +507,7 @@ static void pm112_tick(void)
 
        if (!started) {
                started = 1;
+               printk(KERN_INFO "windfarm: CPUs control loops started.\n");
                for (i = 0; i < nr_cores; ++i) {
                        if (create_cpu_loop(i) < 0) {
                                failure_state = FAILURE_PERM;
@@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_sensor *sr)
 {
        unsigned int i;
 
-       if (have_all_sensors)
-               return;
        if (!strncmp(sr->name, "cpu-temp-", 9)) {
                i = sr->name[9] - '0';
                if (sr->name[10] == 0 && i < NR_CORES &&
@@ -613,7 +615,7 @@ static void pm112_new_sensor(struct wf_sensor *sr)
        } else if (!strcmp(sr->name, "slots-power")) {
                if (slots_power == NULL && wf_get_sensor(sr) == 0)
                        slots_power = sr;
-       } else if (!strcmp(sr->name, "u4-temp")) {
+       } else if (!strcmp(sr->name, "backside-temp")) {
                if (u4_temp == NULL && wf_get_sensor(sr) == 0)
                        u4_temp = sr;
        } else
@@ -648,24 +650,26 @@ static struct notifier_block pm112_events = {
        .notifier_call = pm112_wf_notify,
 };
 
-static int wf_pm112_probe(struct device *dev)
+static int wf_pm112_probe(struct platform_device *dev)
 {
        wf_register_client(&pm112_events);
        return 0;
 }
 
-static int wf_pm112_remove(struct device *dev)
+static int __devexit wf_pm112_remove(struct platform_device *dev)
 {
        wf_unregister_client(&pm112_events);
        /* should release all sensors and controls */
        return 0;
 }
 
-static struct device_driver wf_pm112_driver = {
-       .name = "windfarm",
-       .bus = &platform_bus_type,
+static struct platform_driver wf_pm112_driver = {
        .probe = wf_pm112_probe,
-       .remove = wf_pm112_remove,
+       .remove = __devexit_p(wf_pm112_remove),
+       .driver = {
+               .name = "windfarm",
+               .bus = &platform_bus_type,
+       },
 };
 
 static int __init wf_pm112_init(void)
@@ -681,13 +685,24 @@ static int __init wf_pm112_init(void)
                ++nr_cores;
 
        printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
-       driver_register(&wf_pm112_driver);
+
+#ifdef MODULE
+       request_module("windfarm_smu_controls");
+       request_module("windfarm_smu_sensors");
+       request_module("windfarm_smu_sat");
+       request_module("windfarm_lm75_sensor");
+       request_module("windfarm_max6690_sensor");
+       request_module("windfarm_cpufreq_clamp");
+
+#endif /* MODULE */
+
+       platform_driver_register(&wf_pm112_driver);
        return 0;
 }
 
 static void __exit wf_pm112_exit(void)
 {
-       driver_unregister(&wf_pm112_driver);
+       platform_driver_unregister(&wf_pm112_driver);
 }
 
 module_init(wf_pm112_init);