]> Git Repo - J-linux.git/blobdiff - drivers/base/dd.c
Merge tag 'driver-core-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[J-linux.git] / drivers / base / dd.c
index a41c91bfac0e9ca4a08a5df81d74dba74ffd876c..fb4e2df68d95b9f16d6cf4f07dee1fa828decc05 100644 (file)
@@ -814,13 +814,13 @@ static int __driver_attach(struct device *dev, void *data)
                return ret;
        } /* ret > 0 means positive match */
 
-       if (dev->parent)        /* Needed for USB */
+       if (dev->parent && dev->bus->need_parent_lock)
                device_lock(dev->parent);
        device_lock(dev);
        if (!dev->driver)
                driver_probe_device(drv, dev);
        device_unlock(dev);
-       if (dev->parent)
+       if (dev->parent && dev->bus->need_parent_lock)
                device_unlock(dev->parent);
 
        return 0;
@@ -916,7 +916,7 @@ void device_release_driver_internal(struct device *dev,
                                    struct device_driver *drv,
                                    struct device *parent)
 {
-       if (parent)
+       if (parent && dev->bus->need_parent_lock)
                device_lock(parent);
 
        device_lock(dev);
@@ -924,7 +924,7 @@ void device_release_driver_internal(struct device *dev,
                __device_release_driver(dev, parent);
 
        device_unlock(dev);
-       if (parent)
+       if (parent && dev->bus->need_parent_lock)
                device_unlock(parent);
 }
 
This page took 0.029474 seconds and 4 git commands to generate.