Merge tag 'driver-core-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[muen/linux.git] / drivers / base / core.c
index a36cf1bd07a91370bd9aac591f121399725780b2..110230d865270d50465d8d341686a8a51d0ea482 100644 (file)
@@ -1958,7 +1958,6 @@ void device_del(struct device *dev)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
 
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
 
-       device_links_purge(dev);
        dpm_sysfs_remove(dev);
        if (parent)
                klist_del(&dev->p->knode_parent);
        dpm_sysfs_remove(dev);
        if (parent)
                klist_del(&dev->p->knode_parent);
@@ -1986,6 +1985,7 @@ void device_del(struct device *dev)
        device_pm_remove(dev);
        driver_deferred_probe_del(dev);
        device_remove_properties(dev);
        device_pm_remove(dev);
        driver_deferred_probe_del(dev);
        device_remove_properties(dev);
+       device_links_purge(dev);
 
        /* Notify the platform of the removal, in case they
         * need to do anything...
 
        /* Notify the platform of the removal, in case they
         * need to do anything...