]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/macintosh/windfarm_core.c
[MIPS] DEC: Fix modpost warning.
[linux-2.6-omap-h63xx.git] / drivers / macintosh / windfarm_core.c
index ab3faa702d58b0d70da4a6d9053dc37f9ff44acf..11ced17f438a8469a39cf303eda067ff9b21193b 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
 #include <linux/kthread.h>
 #include <linux/jiffies.h>
 #include <linux/reboot.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
 #include <linux/mutex.h>
+#include <linux/freezer.h>
 
 #include <asm/prom.h>
 
@@ -93,8 +93,6 @@ static int wf_thread_func(void *data)
        DBG("wf: thread started\n");
 
        while(!kthread_should_stop()) {
-               try_to_freeze();
-
                if (time_after_eq(jiffies, next)) {
                        wf_notify(WF_EVENT_TICK, NULL);
                        if (wf_overtemp) {
@@ -117,8 +115,8 @@ static int wf_thread_func(void *data)
                if (delay <= HZ)
                        schedule_timeout_interruptible(delay);
 
-               /* there should be no signal, but oh well */
-               if (signal_pending(current)) {
+               /* there should be no non-suspend signal, but oh well */
+               if (signal_pending(current) && !try_to_freeze()) {
                        printk(KERN_WARNING "windfarm: thread got sigl !\n");
                        break;
                }
@@ -218,7 +216,10 @@ int wf_register_control(struct wf_control *new_ct)
        new_ct->attr.attr.mode = 0644;
        new_ct->attr.show = wf_show_control;
        new_ct->attr.store = wf_store_control;
-       device_create_file(&wf_platform_device.dev, &new_ct->attr);
+       if (device_create_file(&wf_platform_device.dev, &new_ct->attr))
+               printk(KERN_WARNING "windfarm: device_create_file failed"
+                       " for %s\n", new_ct->name);
+               /* the subsystem still does useful work without the file */
 
        DBG("wf: Registered control %s\n", new_ct->name);
 
@@ -328,7 +329,10 @@ int wf_register_sensor(struct wf_sensor *new_sr)
        new_sr->attr.attr.mode = 0444;
        new_sr->attr.show = wf_show_sensor;
        new_sr->attr.store = NULL;
-       device_create_file(&wf_platform_device.dev, &new_sr->attr);
+       if (device_create_file(&wf_platform_device.dev, &new_sr->attr))
+               printk(KERN_WARNING "windfarm: device_create_file failed"
+                       " for %s\n", new_sr->name);
+               /* the subsystem still does useful work without the file */
 
        DBG("wf: Registered sensor %s\n", new_sr->name);