w1_therm_read_bin: don't call flush_signals()
[sfrench/cifs-2.6.git] / drivers / w1 / slaves / w1_therm.c
index 5372cfcbd0543aa1e8e5622f824682af9b87d530..1a6937dc190b777369eac30ace6ea0aa665963bc 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
+#include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/types.h>
 #include <linux/delay.h>
@@ -140,7 +141,7 @@ static inline int w1_convert_temp(u8 rom[9], u8 fid)
 {
        int i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i)
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i)
                if (w1_therm_families[i].f->fid == fid)
                        return w1_therm_families[i].convert(rom);
 
@@ -190,11 +191,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
 
                        w1_write_8(dev, W1_CONVERT_TEMP);
 
-                       while (tm) {
-                               tm = msleep_interruptible(tm);
-                               if (signal_pending(current))
-                                       flush_signals(current);
-                       }
+                       msleep(tm);
 
                        if (!w1_reset_select_slave(sl)) {
 
@@ -237,7 +234,7 @@ static int __init w1_therm_init(void)
 {
        int err, i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i) {
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) {
                err = w1_register_family(w1_therm_families[i].f);
                if (err)
                        w1_therm_families[i].broken = 1;
@@ -250,7 +247,7 @@ static void __exit w1_therm_fini(void)
 {
        int i;
 
-       for (i=0; i<sizeof(w1_therm_families)/sizeof(w1_therm_families[0]); ++i)
+       for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i)
                if (!w1_therm_families[i].broken)
                        w1_unregister_family(w1_therm_families[i].f);
 }