]> 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 7de543d1d0b4337328f95c502915d99b3a4fa871..79848e6c5db59816cd05fa947ee3fa2ef40b882a 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/kdev_t.h>
 #include <linux/notifier.h>
 #include <linux/genhd.h>
+#include <linux/kallsyms.h>
 #include <asm/semaphore.h>
 
 #include "base.h"
@@ -68,6 +69,10 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
 
        if (dev_attr->show)
                ret = dev_attr->show(dev, dev_attr, buf);
+       if (ret >= (ssize_t)PAGE_SIZE) {
+               print_symbol("dev_attr_show: %s returned bad count\n",
+                               (unsigned long)dev_attr->show);
+       }
        return ret;
 }
 
@@ -815,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;