drivers/ misc __iomem annotations
[safe/jmp/linux-2.6] / drivers / w1 / w1.c
index de3e979..8d7ab74 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <linux/kthread.h>
+#include <linux/freezer.h>
 
 #include <asm/atomic.h>
 
@@ -104,7 +105,9 @@ static ssize_t w1_slave_read_name(struct device *dev, struct device_attribute *a
        return sprintf(buf, "%s\n", sl->name);
 }
 
-static ssize_t w1_slave_read_id(struct kobject *kobj, char *buf, loff_t off, size_t count)
+static ssize_t w1_slave_read_id(struct kobject *kobj,
+                               struct bin_attribute *bin_attr,
+                               char *buf, loff_t off, size_t count)
 {
        struct w1_slave *sl = kobj_to_w1_slave(kobj);
 
@@ -127,7 +130,6 @@ static struct bin_attribute w1_slave_attr_bin_id = {
       .attr = {
               .name = "id",
               .mode = S_IRUGO,
-              .owner = THIS_MODULE,
       },
       .size = 8,
       .read = w1_slave_read_id,
@@ -135,7 +137,9 @@ static struct bin_attribute w1_slave_attr_bin_id = {
 
 /* Default family */
 
-static ssize_t w1_default_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
+static ssize_t w1_default_write(struct kobject *kobj,
+                               struct bin_attribute *bin_attr,
+                               char *buf, loff_t off, size_t count)
 {
        struct w1_slave *sl = kobj_to_w1_slave(kobj);
 
@@ -152,7 +156,9 @@ out_up:
        return count;
 }
 
-static ssize_t w1_default_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
+static ssize_t w1_default_read(struct kobject *kobj,
+                              struct bin_attribute *bin_attr,
+                              char *buf, loff_t off, size_t count)
 {
        struct w1_slave *sl = kobj_to_w1_slave(kobj);
 
@@ -166,7 +172,6 @@ static struct bin_attribute w1_default_attr = {
       .attr = {
               .name = "rw",
               .mode = S_IRUGO | S_IWUSR,
-              .owner = THIS_MODULE,
       },
       .size = PAGE_SIZE,
       .read = w1_default_read,
@@ -458,7 +463,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
                 (unsigned long long) sl->reg_num.id);
 
        dev_dbg(&sl->dev, "%s: registering %s as %p.\n", __func__,
-               &sl->dev.bus_id[0]);
+               &sl->dev.bus_id[0], sl);
 
        err = device_register(&sl->dev);
        if (err < 0) {
@@ -515,7 +520,7 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
        int err;
        struct w1_netlink_msg msg;
 
-       sl = kmalloc(sizeof(struct w1_slave), GFP_KERNEL);
+       sl = kzalloc(sizeof(struct w1_slave), GFP_KERNEL);
        if (!sl) {
                dev_err(&dev->dev,
                         "%s: failed to allocate new slave device.\n",
@@ -523,7 +528,6 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
                return -ENOMEM;
        }
 
-       memset(sl, 0, sizeof(*sl));
 
        sl->owner = THIS_MODULE;
        sl->master = dev;
@@ -800,6 +804,7 @@ static int w1_control(void *data)
        struct w1_master *dev, *n;
        int have_to_wait = 0;
 
+       set_freezable();
        while (!kthread_should_stop() || have_to_wait) {
                have_to_wait = 0;