]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - drivers/base/component.c
component: do not leave master devres group open after bind
[mirror_ubuntu-kernels.git] / drivers / base / component.c
index 5e79299f6c3ffdcb0070292c76f7be1a29cc8656..2d25a6416587996e6fcd3e9817292db3ae94742c 100644 (file)
@@ -9,7 +9,6 @@
  */
 #include <linux/component.h>
 #include <linux/device.h>
-#include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
@@ -246,7 +245,7 @@ static int try_to_bring_up_master(struct master *master,
                return 0;
        }
 
-       if (!devres_open_group(master->parent, NULL, GFP_KERNEL))
+       if (!devres_open_group(master->parent, master, GFP_KERNEL))
                return -ENOMEM;
 
        /* Found all components */
@@ -258,6 +257,7 @@ static int try_to_bring_up_master(struct master *master,
                return ret;
        }
 
+       devres_close_group(master->parent, NULL);
        master->bound = true;
        return 1;
 }
@@ -282,7 +282,7 @@ static void take_down_master(struct master *master)
 {
        if (master->bound) {
                master->ops->unbind(master->parent);
-               devres_release_group(master->parent, NULL);
+               devres_release_group(master->parent, master);
                master->bound = false;
        }
 }