aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/dd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/dd.c')
-rw-r--r--drivers/base/dd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index b5bf243d9cd6..6a48824e43ff 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -112,6 +112,7 @@ static int really_probe(void *void_data)
112 atomic_inc(&probe_count); 112 atomic_inc(&probe_count);
113 pr_debug("%s: Probing driver %s with device %s\n", 113 pr_debug("%s: Probing driver %s with device %s\n",
114 drv->bus->name, drv->name, dev->bus_id); 114 drv->bus->name, drv->name, dev->bus_id);
115 WARN_ON(!list_empty(&dev->devres_head));
115 116
116 dev->driver = drv; 117 dev->driver = drv;
117 if (driver_sysfs_add(dev)) { 118 if (driver_sysfs_add(dev)) {
@@ -137,6 +138,7 @@ static int really_probe(void *void_data)
137 goto done; 138 goto done;
138 139
139probe_failed: 140probe_failed:
141 devres_release_all(dev);
140 driver_sysfs_remove(dev); 142 driver_sysfs_remove(dev);
141 dev->driver = NULL; 143 dev->driver = NULL;
142 144
@@ -327,6 +329,7 @@ static void __device_release_driver(struct device * dev)
327 dev->bus->remove(dev); 329 dev->bus->remove(dev);
328 else if (drv->remove) 330 else if (drv->remove)
329 drv->remove(dev); 331 drv->remove(dev);
332 devres_release_all(dev);
330 dev->driver = NULL; 333 dev->driver = NULL;
331 put_driver(drv); 334 put_driver(drv);
332 } 335 }