Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / base / core.c
index c8ae1f6b01b93434bf878c1622d0d47bd20110a5..a235085e343c47ca2b643f876c31ab70032359b5 100644 (file)
@@ -1201,7 +1201,6 @@ void device_del(struct device *dev)
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
-       device_pm_remove(dev);
        dpm_sysfs_remove(dev);
        if (parent)
                klist_del(&dev->p->knode_parent);
@@ -1226,6 +1225,7 @@ void device_del(struct device *dev)
        device_remove_file(dev, &uevent_attr);
        device_remove_attrs(dev);
        bus_remove_device(dev);
+       device_pm_remove(dev);
        driver_deferred_probe_del(dev);
 
        /* Notify the platform of the removal, in case they
@@ -1420,7 +1420,7 @@ struct root_device {
        struct module *owner;
 };
 
-inline struct root_device *to_root_device(struct device *d)
+static inline struct root_device *to_root_device(struct device *d)
 {
        return container_of(d, struct root_device, dev);
 }
@@ -1861,10 +1861,12 @@ void device_shutdown(void)
                pm_runtime_barrier(dev);
 
                if (dev->bus && dev->bus->shutdown) {
-                       dev_dbg(dev, "shutdown\n");
+                       if (initcall_debug)
+                               dev_info(dev, "shutdown\n");
                        dev->bus->shutdown(dev);
                } else if (dev->driver && dev->driver->shutdown) {
-                       dev_dbg(dev, "shutdown\n");
+                       if (initcall_debug)
+                               dev_info(dev, "shutdown\n");
                        dev->driver->shutdown(dev);
                }