ixgb: Use generic MDIO definitions
[safe/jmp/linux-2.6] / drivers / macintosh / therm_adt746x.c
index 5366dc9..c0621d5 100644 (file)
 #include <linux/kthread.h>
 #include <linux/moduleparam.h>
 #include <linux/freezer.h>
+#include <linux/of_platform.h>
 
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/sections.h>
-#include <asm/of_platform.h>
 
 #undef DEBUG
 
@@ -498,8 +498,8 @@ static ssize_t store_##name(struct device *dev, struct device_attribute *attr, c
 #define BUILD_STORE_FUNC_INT(name, data)                       \
 static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
 {                                                              \
-       u32 val;                                                \
-       val = simple_strtoul(buf, NULL, 10);                    \
+       int val;                                                \
+       val = simple_strtol(buf, NULL, 10);                     \
        if (val < 0 || val > 255)                               \
                return -EINVAL;                                 \
        printk(KERN_INFO "Setting specified fan speed to %d\n", val);   \
@@ -554,7 +554,7 @@ thermostat_init(void)
        const u32 *prop;
        int i = 0, offset = 0;
        int err;
-       
+
        np = of_find_node_by_name(NULL, "fan");
        if (!np)
                return -ENODEV;
@@ -613,13 +613,13 @@ thermostat_init(void)
        }
 
        of_dev = of_platform_device_create(np, "temperatures", NULL);
-       
+       of_node_put(np);
+
        if (of_dev == NULL) {
                printk(KERN_ERR "Can't register temperatures device !\n");
-               of_node_put(np);
                return -ENODEV;
        }
-       
+
        err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
        err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
        err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);