]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/core.c
PM: Remove destroy_suspended_device()
[linux-2.6-omap-h63xx.git] / drivers / base / core.c
index 7de543d1d0b4337328f95c502915d99b3a4fa871..0262fc7c45fcbc2673d3a3d687973228aa9ee538 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;
 }
 
@@ -812,13 +817,12 @@ int device_add(struct device *dev)
        error = device_add_attrs(dev);
        if (error)
                goto AttrsError;
-       error = dpm_sysfs_add(dev);
-       if (error)
-               goto PMError;
-       device_pm_add(dev);
        error = bus_add_device(dev);
        if (error)
                goto BusError;
+       error = device_pm_add(dev);
+       if (error)
+               goto PMError;
        kobject_uevent(&dev->kobj, KOBJ_ADD);
        bus_attach_device(dev);
        if (parent)
@@ -838,9 +842,9 @@ int device_add(struct device *dev)
  Done:
        put_device(dev);
        return error;
- BusError:
-       device_pm_remove(dev);
  PMError:
+       bus_remove_device(dev);
+ BusError:
        if (dev->bus)
                blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                             BUS_NOTIFY_DEL_DEVICE, dev);
@@ -1159,35 +1163,6 @@ void device_destroy(struct class *class, dev_t devt)
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
-#ifdef CONFIG_PM_SLEEP
-/**
- * destroy_suspended_device - asks the PM core to remove a suspended device
- * @class: pointer to the struct class that this device was registered with
- * @devt: the dev_t of the device that was previously registered
- *
- * This call notifies the PM core of the necessity to unregister a suspended
- * device created with a call to device_create() (devices cannot be
- * unregistered directly while suspended, since the PM core holds their
- * semaphores at that time).
- *
- * It can only be called within the scope of a system sleep transition.  In
- * practice this means it has to be directly or indirectly invoked either by
- * a suspend or resume method, or by the PM core (e.g. via
- * disable_nonboot_cpus() or enable_nonboot_cpus()).
- */
-void destroy_suspended_device(struct class *class, dev_t devt)
-{
-       struct device *dev;
-
-       dev = class_find_device(class, &devt, __match_devt);
-       if (dev) {
-               device_pm_schedule_removal(dev);
-               put_device(dev);
-       }
-}
-EXPORT_SYMBOL_GPL(destroy_suspended_device);
-#endif /* CONFIG_PM_SLEEP */
-
 /**
  * device_rename - renames a device
  * @dev: the pointer to the struct device to be renamed