tty: The big operations rework
[deliverable/linux.git] / drivers / pnp / driver.c
index 2fa64a6b25c86d7c69fc053999463c0b6ff3cda0..e85cbf116db131c5eaa78c6ffbcde234bb33c750 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,6 +113,8 @@ static int pnp_device_probe(struct device *dev)
                error = 0;
        } else
                goto fail;
+
+       dev_dbg(dev, "driver attached\n");
        return error;
 
 fail:
@@ -162,14 +161,13 @@ 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;
        }
 
-       if (pnp_dev->protocol && pnp_dev->protocol->suspend)
+       if (pnp_dev->protocol->suspend)
                pnp_dev->protocol->suspend(pnp_dev, state);
        return 0;
 }
@@ -183,17 +181,20 @@ static int pnp_bus_resume(struct device *dev)
        if (!pnp_drv)
                return 0;
 
-       if (pnp_dev->protocol && pnp_dev->protocol->resume)
+       if (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;
 }
This page took 0.027053 seconds and 5 git commands to generate.