Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c72426f0539c1abce17918d1456f7a6a5a11f90
Commit:     3c72426f0539c1abce17918d1456f7a6a5a11f90
Parent:     5ceadd2a2a9cf2768a9baf808abf1ffeedcc4cc4
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 01:38:10 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 10:41:10 2008 -0800

    spi core: stop updating dev->power.power_state
    
    Don't update dev->power.power_state any more in the SPI core.  The only
    reason to update this scheduled-to-be-removed field was to make the
    already-removed /sys/devices/.../power/state files work better.
    
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/spi/spi.c |   34 ++++++++++++++--------------------
 1 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 5e5d29b..1ad12af 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -76,39 +76,33 @@ static int spi_uevent(struct device *dev, struct 
kobj_uevent_env *env)
 
 #ifdef CONFIG_PM
 
-/*
- * NOTE:  the suspend() method for an spi_master controller driver
- * should verify that all its child devices are marked as suspended;
- * suspend requests delivered through sysfs power/state files don't
- * enforce such constraints.
- */
 static int spi_suspend(struct device *dev, pm_message_t message)
 {
-       int                     value;
+       int                     value = 0;
        struct spi_driver       *drv = to_spi_driver(dev->driver);
 
-       if (!drv || !drv->suspend)
-               return 0;
-
        /* suspend will stop irqs and dma; no more i/o */
-       value = drv->suspend(to_spi_device(dev), message);
-       if (value == 0)
-               dev->power.power_state = message;
+       if (drv) {
+               if (drv->suspend)
+                       value = drv->suspend(to_spi_device(dev), message);
+               else
+                       dev_dbg(dev, "... can't suspend\n");
+       }
        return value;
 }
 
 static int spi_resume(struct device *dev)
 {
-       int                     value;
+       int                     value = 0;
        struct spi_driver       *drv = to_spi_driver(dev->driver);
 
-       if (!drv || !drv->resume)
-               return 0;
-
        /* resume may restart the i/o queue */
-       value = drv->resume(to_spi_device(dev));
-       if (value == 0)
-               dev->power.power_state = PMSG_ON;
+       if (drv) {
+               if (drv->resume)
+                       value = drv->resume(to_spi_device(dev));
+               else
+                       dev_dbg(dev, "... can't resume\n");
+       }
        return value;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to