]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pnp/driver.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / pnp / driver.c
index 30b8f6f3258afa48bf546e297d79014daacb877d..12a1645a2e4352b3a3cc8e07941a9888dd5567cb 100644 (file)
@@ -86,9 +86,6 @@ static int pnp_device_probe(struct device *dev)
        pnp_dev = to_pnp_dev(dev);
        pnp_drv = to_pnp_driver(dev->driver);
 
-       pnp_dbg("match found with the PnP device '%s' and the driver '%s'",
-               dev->bus_id, pnp_drv->name);
-
        error = pnp_device_attach(pnp_dev);
        if (error < 0)
                return error;
@@ -116,9 +113,11 @@ static int pnp_device_probe(struct device *dev)
                error = 0;
        } else
                goto fail;
+
+       dev_dbg(dev, "driver attached\n");
        return error;
 
-      fail:
+fail:
        pnp_device_detach(pnp_dev);
        return error;
 }
@@ -162,8 +161,7 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state)
                        return error;
        }
 
-       if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE) &&
-           pnp_can_disable(pnp_dev)) {
+       if (pnp_can_disable(pnp_dev)) {
                error = pnp_stop_dev(pnp_dev);
                if (error)
                        return error;
@@ -186,14 +184,17 @@ static int pnp_bus_resume(struct device *dev)
        if (pnp_dev->protocol && pnp_dev->protocol->resume)
                pnp_dev->protocol->resume(pnp_dev);
 
-       if (!(pnp_drv->flags & PNP_DRIVER_RES_DO_NOT_CHANGE)) {
+       if (pnp_can_write(pnp_dev)) {
                error = pnp_start_dev(pnp_dev);
                if (error)
                        return error;
        }
 
-       if (pnp_drv->resume)
-               return pnp_drv->resume(pnp_dev);
+       if (pnp_drv->resume) {
+               error = pnp_drv->resume(pnp_dev);
+               if (error)
+                       return error;
+       }
 
        return 0;
 }
@@ -232,10 +233,6 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
 {
        struct pnp_id *ptr;
 
-       if (!id)
-               return -EINVAL;
-       if (!dev)
-               return -EINVAL;
        id->next = NULL;
        ptr = dev->id;
        while (ptr && ptr->next)