]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/w1/w1.c
[PATCH] mtd_dataflash, fix block vs page erase
[linux-2.6-omap-h63xx.git] / drivers / w1 / w1.c
index 4e98ab1aa2f2f86ea11358a67cb07b76d89d41b6..024206c4a0e499e469b9f923295f5a03a7e46c17 100644 (file)
@@ -77,8 +77,7 @@ static void w1_master_release(struct device *dev)
 
        dev_dbg(dev, "%s: Releasing %s.\n", __func__, md->name);
 
-       if (md->nls && md->nls->sk_socket)
-               sock_release(md->nls->sk_socket);
+       dev_fini_netlink(md);
        memset(md, 0, sizeof(struct w1_master) + sizeof(struct w1_bus_master));
        kfree(md);
 }
@@ -143,12 +142,12 @@ static struct bin_attribute w1_slave_attr_bin_id = {
 /* Default family */
 static struct w1_family w1_default_family;
 
-static int w1_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size);
+static int w1_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size);
 
 static struct bus_type w1_bus_type = {
        .name = "w1",
        .match = w1_master_match,
-       .hotplug = w1_hotplug,
+       .uevent = w1_uevent,
 };
 
 struct device_driver w1_master_driver = {
@@ -362,7 +361,7 @@ void w1_destroy_master_attributes(struct w1_master *master)
 }
 
 #ifdef CONFIG_HOTPLUG
-static int w1_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
+static int w1_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
 {
        struct w1_master *md = NULL;
        struct w1_slave *sl = NULL;
@@ -378,7 +377,7 @@ static int w1_hotplug(struct device *dev, char **envp, int num_envp, char *buffe
                event_owner = "slave";
                name = sl->name;
        } else {
-               dev_dbg(dev, "Unknown hotplug event.\n");
+               dev_dbg(dev, "Unknown event.\n");
                return -EINVAL;
        }
 
@@ -387,18 +386,18 @@ static int w1_hotplug(struct device *dev, char **envp, int num_envp, char *buffe
        if (dev->driver != &w1_slave_driver || !sl)
                return 0;
 
-       err = add_hotplug_env_var(envp, num_envp, &cur_index, buffer, buffer_size, &cur_len, "W1_FID=%02X", sl->reg_num.family);
+       err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, &cur_len, "W1_FID=%02X", sl->reg_num.family);
        if (err)
                return err;
 
-       err = add_hotplug_env_var(envp, num_envp, &cur_index, buffer, buffer_size, &cur_len, "W1_SLAVE_ID=%024LX", (u64)sl->reg_num.id);
+       err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, &cur_len, "W1_SLAVE_ID=%024LX", (u64)sl->reg_num.id);
        if (err)
                return err;
 
        return 0;
 };
 #else
-static int w1_hotplug(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
+static int w1_uevent(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size)
 {
        return 0;
 }
@@ -527,8 +526,6 @@ static int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
        msg.type = W1_SLAVE_ADD;
        w1_netlink_send(dev, &msg);
 
-       dev_info(&dev->dev, "Finished %s for sl=%p.\n", __func__, sl);
-
        return 0;
 }
 
@@ -536,7 +533,7 @@ static void w1_slave_detach(struct w1_slave *sl)
 {
        struct w1_netlink_msg msg;
 
-       dev_info(&sl->dev, "%s: detaching %s [%p].\n", __func__, sl->name, sl);
+       dev_dbg(&sl->dev, "%s: detaching %s [%p].\n", __func__, sl->name, sl);
 
        list_del(&sl->w1_slave_entry);
 
@@ -579,7 +576,7 @@ void w1_reconnect_slaves(struct w1_family *f)
 
        spin_lock_bh(&w1_mlock);
        list_for_each_entry(dev, &w1_masters, w1_master_entry) {
-               dev_info(&dev->dev, "Reconnecting slaves in %s into new family %02x.\n",
+               dev_dbg(&dev->dev, "Reconnecting slaves in %s into new family %02x.\n",
                                dev->name, f->fid);
                set_bit(W1_MASTER_NEED_RECONNECT, &dev->flags);
        }
@@ -768,7 +765,7 @@ static int w1_control(void *data)
                        }
 
                        if (test_bit(W1_MASTER_NEED_RECONNECT, &dev->flags)) {
-                               dev_info(&dev->dev, "Reconnecting slaves in device %s.\n", dev->name);
+                               dev_dbg(&dev->dev, "Reconnecting slaves in device %s.\n", dev->name);
                                down(&dev->mutex);
                                list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) {
                                        if (sl->family->fid == W1_FAMILY_DEFAULT) {
@@ -780,7 +777,7 @@ static int w1_control(void *data)
                                                w1_attach_slave_device(dev, &rn);
                                        }
                                }
-                               dev_info(&dev->dev, "Reconnecting slaves in device %s has been finished.\n", dev->name);
+                               dev_dbg(&dev->dev, "Reconnecting slaves in device %s has been finished.\n", dev->name);
                                clear_bit(W1_MASTER_NEED_RECONNECT, &dev->flags);
                                up(&dev->mutex);
                        }