drm/sti: removed optional dummy encoder mode_fixup function.
[deliverable/linux.git] / drivers / base / dd.c
index 7399be790b5dbdf8715694522ba410cdede2808f..c4da2df62e02525617a23ebe68fff4af0bb69350 100644 (file)
@@ -223,9 +223,23 @@ static int deferred_probe_initcall(void)
 }
 late_initcall(deferred_probe_initcall);
 
+/**
+ * device_is_bound() - Check if device is bound to a driver
+ * @dev: device to check
+ *
+ * Returns true if passed device has already finished probing successfully
+ * against a driver.
+ *
+ * This function must be called with the device lock held.
+ */
+bool device_is_bound(struct device *dev)
+{
+       return dev->p && klist_node_attached(&dev->p->knode_driver);
+}
+
 static void driver_bound(struct device *dev)
 {
-       if (klist_node_attached(&dev->p->knode_driver)) {
+       if (device_is_bound(dev)) {
                printk(KERN_WARNING "%s: device %s already bound\n",
                        __func__, kobject_name(&dev->kobj));
                return;
@@ -236,6 +250,8 @@ static void driver_bound(struct device *dev)
 
        klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices);
 
+       device_pm_check_callbacks(dev);
+
        /*
         * Make sure the device is no longer in one of the deferred lists and
         * kick off retrying all pending devices
@@ -601,7 +617,7 @@ static int __device_attach(struct device *dev, bool allow_async)
 
        device_lock(dev);
        if (dev->driver) {
-               if (klist_node_attached(&dev->p->knode_driver)) {
+               if (device_is_bound(dev)) {
                        ret = 1;
                        goto out_unlock;
                }
@@ -752,6 +768,7 @@ static void __device_release_driver(struct device *dev)
                pm_runtime_reinit(dev);
 
                klist_remove(&dev->p->knode_driver);
+               device_pm_check_callbacks(dev);
                if (dev->bus)
                        blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
                                                     BUS_NOTIFY_UNBOUND_DRIVER,
This page took 0.026019 seconds and 5 git commands to generate.