]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/core.c
PM: Handle device registrations during suspend/resume
[linux-2.6-omap-h63xx.git] / drivers / base / core.c
index 24198ad0197654943ae95250b22386358cb22e71..79848e6c5db59816cd05fa947ee3fa2ef40b882a 100644 (file)
@@ -820,7 +820,11 @@ int device_add(struct device *dev)
        error = dpm_sysfs_add(dev);
        if (error)
                goto PMError;
-       device_pm_add(dev);
+       error = device_pm_add(dev);
+       if (error) {
+               dpm_sysfs_remove(dev);
+               goto PMError;
+       }
        error = bus_add_device(dev);
        if (error)
                goto BusError;