[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
authorRussell King <rmk@arm.linux.org.uk>
Fri, 28 Oct 2005 16:52:56 +0000 (09:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 16:52:56 +0000 (09:52 -0700)
In PM v1, all devices were called at SUSPEND_DISABLE level.  Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level.  However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.

Since this is obsolete infrastructure which is no longer necessary,
we can remove it.  Here's an (untested) patch to do exactly that.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
66 files changed:
Documentation/driver-model/driver.txt
arch/arm/common/locomo.c
arch/arm/common/sa1111.c
arch/arm/common/scoop.c
arch/arm/mach-pxa/corgi_ssp.c
arch/arm/mach-sa1100/neponset.c
drivers/base/platform.c
drivers/char/s3c2410-rtc.c
drivers/char/sonypi.c
drivers/char/watchdog/s3c2410_wdt.c
drivers/hwmon/hdaps.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/i2c-core.c
drivers/ieee1394/nodemgr.c
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/spitzkbd.c
drivers/input/serio/i8042.c
drivers/input/touchscreen/corgi_ts.c
drivers/media/video/msp3400.c
drivers/media/video/tda9887.c
drivers/media/video/tuner-core.c
drivers/mfd/mcp-sa11x0.c
drivers/mmc/pxamci.c
drivers/mmc/wbsd.c
drivers/mtd/maps/sa1100-flash.c
drivers/net/dm9000.c
drivers/net/irda/sa1100_ir.c
drivers/net/irda/smsc-ircc2.c
drivers/net/phy/mdio_bus.c
drivers/net/smc91x.c
drivers/pci/pcie/portdrv_core.c
drivers/pcmcia/au1000_generic.c
drivers/pcmcia/hd64465_ss.c
drivers/pcmcia/i82365.c
drivers/pcmcia/m32r_cfc.c
drivers/pcmcia/m32r_pcc.c
drivers/pcmcia/omap_cf.c
drivers/pcmcia/pxa2xx_base.c
drivers/pcmcia/sa1100_generic.c
drivers/pcmcia/tcic.c
drivers/pcmcia/vrc4171_card.c
drivers/serial/8250.c
drivers/serial/imx.c
drivers/serial/mpc52xx_uart.c
drivers/serial/pxa.c
drivers/serial/s3c2410.c
drivers/serial/sa1100.c
drivers/serial/vr41xx_siu.c
drivers/usb/gadget/dummy_hcd.c
drivers/usb/gadget/omap_udc.c
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/ohci-omap.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/sl811-hcd.c
drivers/video/backlight/corgi_bl.c
drivers/video/imxfb.c
drivers/video/pxafb.c
drivers/video/s1d13xxxfb.c
drivers/video/s3c2410fb.c
drivers/video/sa1100fb.c
drivers/video/w100fb.c
include/linux/device.h
sound/arm/pxa2xx-ac97.c
sound/core/init.c
sound/pci/ac97/ac97_bus.c

index fabaca1ab1b0b0f56980a4802b81b7a11e1aa241..7c26bfae4ba0d4475e2d9d87578c69a34f16bcab 100644 (file)
@@ -196,67 +196,11 @@ it into a supported low-power state.
 
        int     (*suspend)      (struct device * dev, pm_message_t state, u32 level);
 
-suspend is called to put the device in a low power state. There are
-several stages to successfully suspending a device, which is denoted in
-the @level parameter. Breaking the suspend transition into several
-stages affords the platform flexibility in performing device power
-management based on the requirements of the system and the
-user-defined policy.
-
-SUSPEND_NOTIFY notifies the device that a suspend transition is about
-to happen. This happens on system power state transitions to verify
-that all devices can successfully suspend.
-
-A driver may choose to fail on this call, which should cause the
-entire suspend transition to fail. A driver should fail only if it
-knows that the device will not be able to be resumed properly when the
-system wakes up again. It could also fail if it somehow determines it
-is in the middle of an operation too important to stop.
-
-SUSPEND_DISABLE tells the device to stop I/O transactions. When it
-stops transactions, or what it should do with unfinished transactions
-is a policy of the driver. After this call, the driver should not
-accept any other I/O requests.
-
-SUSPEND_SAVE_STATE tells the device to save the context of the
-hardware. This includes any bus-specific hardware state and
-device-specific hardware state. A pointer to this saved state can be
-stored in the device's saved_state field.
-
-SUSPEND_POWER_DOWN tells the driver to place the device in the low
-power state requested. 
-
-Whether suspend is called with a given level is a policy of the
-platform. Some levels may be omitted; drivers must not assume the
-reception of any level. However, all levels must be called in the
-order above; i.e. notification will always come before disabling;
-disabling the device will come before suspending the device.
-
-All calls are made with interrupts enabled, except for the
-SUSPEND_POWER_DOWN level.
+suspend is called to put the device in a low power state.
 
        int     (*resume)       (struct device * dev, u32 level);
 
-Resume is used to bring a device back from a low power state. Like the
-suspend transition, it happens in several stages. 
-
-RESUME_POWER_ON tells the driver to set the power state to the state
-before the suspend call (The device could have already been in a low
-power state before the suspend call to put in a lower power state). 
-
-RESUME_RESTORE_STATE tells the driver to restore the state saved by
-the SUSPEND_SAVE_STATE suspend call. 
-
-RESUME_ENABLE tells the driver to start accepting I/O transactions
-again. Depending on driver policy, the device may already have pending
-I/O requests. 
-
-RESUME_POWER_ON is called with interrupts disabled. The other resume
-levels are called with interrupts enabled. 
-
-As with the various suspend stages, the driver must not assume that
-any other resume calls have been or will be made. Each call should be
-self-contained and not dependent on any external state.
+Resume is used to bring a device back from a low power state.
 
 
 Attributes
index e8053d16829b877bf6f5a8c4269900549bada9f1..5cdb4122f057ca64874024d50b1750f9375cb649 100644 (file)
@@ -550,15 +550,12 @@ struct locomo_save_data {
        u16     LCM_SPIMD;
 };
 
-static int locomo_suspend(struct device *dev, pm_message_t state, u32 level)
+static int locomo_suspend(struct device *dev, pm_message_t state)
 {
        struct locomo *lchip = dev_get_drvdata(dev);
        struct locomo_save_data *save;
        unsigned long flags;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        save = kmalloc(sizeof(struct locomo_save_data), GFP_KERNEL);
        if (!save)
                return -ENOMEM;
@@ -597,16 +594,13 @@ static int locomo_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int locomo_resume(struct device *dev, u32 level)
+static int locomo_resume(struct device *dev)
 {
        struct locomo *lchip = dev_get_drvdata(dev);
        struct locomo_save_data *save;
        unsigned long r;
        unsigned long flags;
        
-       if (level != RESUME_ENABLE)
-               return 0;
-
        save = (struct locomo_save_data *) dev->power.saved_state;
        if (!save)
                return 0;
index 1a47fbf9cbbc939a9f8f484c5c89301752000cc5..21e2a518ad3ab71c85edf68e47468e04666d1866 100644 (file)
@@ -801,7 +801,7 @@ struct sa1111_save_data {
 
 #ifdef CONFIG_PM
 
-static int sa1111_suspend(struct device *dev, pm_message_t state, u32 level)
+static int sa1111_suspend(struct device *dev, pm_message_t state)
 {
        struct sa1111 *sachip = dev_get_drvdata(dev);
        struct sa1111_save_data *save;
@@ -809,9 +809,6 @@ static int sa1111_suspend(struct device *dev, pm_message_t state, u32 level)
        unsigned int val;
        void __iomem *base;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
        if (!save)
                return -ENOMEM;
@@ -856,23 +853,19 @@ static int sa1111_suspend(struct device *dev, pm_message_t state, u32 level)
 /*
  *     sa1111_resume - Restore the SA1111 device state.
  *     @dev: device to restore
- *     @level: resume level
  *
  *     Restore the general state of the SA1111; clock control and
  *     interrupt controller.  Other parts of the SA1111 must be
  *     restored by their respective drivers, and must be called
  *     via LDM after this function.
  */
-static int sa1111_resume(struct device *dev, u32 level)
+static int sa1111_resume(struct device *dev)
 {
        struct sa1111 *sachip = dev_get_drvdata(dev);
        struct sa1111_save_data *save;
        unsigned long flags, id;
        void __iomem *base;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        save = (struct sa1111_save_data *)dev->power.saved_state;
        if (!save)
                return 0;
index 9e5245c702de33f438a25bf42aec4710e8d8b2df..e8356b76d7c6e1fcaf3155b886085ef64c5c6e64 100644 (file)
@@ -102,26 +102,24 @@ static void check_scoop_reg(struct scoop_dev *sdev)
 }
 
 #ifdef CONFIG_PM
-static int scoop_suspend(struct device *dev, pm_message_t state, uint32_t level)
+static int scoop_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               struct scoop_dev *sdev = dev_get_drvdata(dev);
+       struct scoop_dev *sdev = dev_get_drvdata(dev);
+
+       check_scoop_reg(sdev);
+       sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR);
+       SCOOP_REG(sdev->base, SCOOP_GPWR) = (sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set;
 
-               check_scoop_reg(sdev);
-               sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR);
-               SCOOP_REG(sdev->base, SCOOP_GPWR) = (sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set;
-       }
        return 0;
 }
 
-static int scoop_resume(struct device *dev, uint32_t level)
+static int scoop_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               struct scoop_dev *sdev = dev_get_drvdata(dev);
+       struct scoop_dev *sdev = dev_get_drvdata(dev);
+
+       check_scoop_reg(sdev);
+       SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr;
 
-               check_scoop_reg(sdev);
-               SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr;
-       }
        return 0;
 }
 #else
index 0ef42828705526b5fc06823144791e3a93351fbb..136c269db0b7965c8b2a93e9c4abc326ab56714d 100644 (file)
@@ -222,24 +222,22 @@ static int corgi_ssp_remove(struct device *dev)
        return 0;
 }
 
-static int corgi_ssp_suspend(struct device *dev, pm_message_t state, u32 level)
+static int corgi_ssp_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               ssp_flush(&corgi_ssp_dev);
-               ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state);
-       }
+       ssp_flush(&corgi_ssp_dev);
+       ssp_save_state(&corgi_ssp_dev,&corgi_ssp_state);
+
        return 0;
 }
 
-static int corgi_ssp_resume(struct device *dev, u32 level)
+static int corgi_ssp_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);  /* High - Disable LCD Control/Timing Gen */
-               GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/
-               GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/
-               ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state);
-               ssp_enable(&corgi_ssp_dev);
-       }
+       GPSR(ssp_machinfo->cs_lcdcon) = GPIO_bit(ssp_machinfo->cs_lcdcon);  /* High - Disable LCD Control/Timing Gen */
+       GPSR(ssp_machinfo->cs_max1111) = GPIO_bit(ssp_machinfo->cs_max1111); /* High - Disable MAX1111*/
+       GPSR(ssp_machinfo->cs_ads7846) = GPIO_bit(ssp_machinfo->cs_ads7846); /* High - Disable ADS7846*/
+       ssp_restore_state(&corgi_ssp_dev,&corgi_ssp_state);
+       ssp_enable(&corgi_ssp_dev);
+
        return 0;
 }
 
index fc061641b7be083cb44d89e33fa22c3826e9c272..7609d69cf1cce0dffca7ed6fa516c41fbd37036b 100644 (file)
@@ -178,33 +178,27 @@ static int neponset_probe(struct device *dev)
 /*
  * LDM power management.
  */
-static int neponset_suspend(struct device *dev, pm_message_t state, u32 level)
+static int neponset_suspend(struct device *dev, pm_message_t state)
 {
        /*
         * Save state.
         */
-       if (level == SUSPEND_SAVE_STATE ||
-           level == SUSPEND_DISABLE ||
-           level == SUSPEND_POWER_DOWN) {
-               if (!dev->power.saved_state)
-                       dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
-               if (!dev->power.saved_state)
-                       return -ENOMEM;
-
-               *(unsigned int *)dev->power.saved_state = NCR_0;
-       }
+       if (!dev->power.saved_state)
+               dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
+       if (!dev->power.saved_state)
+               return -ENOMEM;
+
+       *(unsigned int *)dev->power.saved_state = NCR_0;
 
        return 0;
 }
 
-static int neponset_resume(struct device *dev, u32 level)
+static int neponset_resume(struct device *dev)
 {
-       if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
-               if (dev->power.saved_state) {
-                       NCR_0 = *(unsigned int *)dev->power.saved_state;
-                       kfree(dev->power.saved_state);
-                       dev->power.saved_state = NULL;
-               }
+       if (dev->power.saved_state) {
+               NCR_0 = *(unsigned int *)dev->power.saved_state;
+               kfree(dev->power.saved_state);
+               dev->power.saved_state = NULL;
        }
 
        return 0;
index a1a56ff65b7647b3f2db43442a92f9c848e5932f..75ce8711bca5d7a6df22f06167a932145ed33b6a 100644 (file)
@@ -281,13 +281,9 @@ static int platform_suspend(struct device * dev, pm_message_t state)
 {
        int ret = 0;
 
-       if (dev->driver && dev->driver->suspend) {
-               ret = dev->driver->suspend(dev, state, SUSPEND_DISABLE);
-               if (ret == 0)
-                       ret = dev->driver->suspend(dev, state, SUSPEND_SAVE_STATE);
-               if (ret == 0)
-                       ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
-       }
+       if (dev->driver && dev->driver->suspend)
+               ret = dev->driver->suspend(dev, state);
+
        return ret;
 }
 
@@ -295,13 +291,9 @@ static int platform_resume(struct device * dev)
 {
        int ret = 0;
 
-       if (dev->driver && dev->driver->resume) {
-               ret = dev->driver->resume(dev, RESUME_POWER_ON);
-               if (ret == 0)
-                       ret = dev->driver->resume(dev, RESUME_RESTORE_STATE);
-               if (ret == 0)
-                       ret = dev->driver->resume(dev, RESUME_ENABLE);
-       }
+       if (dev->driver && dev->driver->resume)
+               ret = dev->driver->resume(dev);
+
        return ret;
 }
 
index e1a90d9a8756711bfc5c85a7fb87b19f1efe9d6a..887b8b2d7882780d29bd86bfd56f9140daebbce8 100644 (file)
@@ -519,30 +519,28 @@ static struct timespec s3c2410_rtc_delta;
 
 static int ticnt_save;
 
-static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state, u32 level)
+static int s3c2410_rtc_suspend(struct device *dev, pm_message_t state)
 {
        struct rtc_time tm;
        struct timespec time;
 
        time.tv_nsec = 0;
 
-       if (level == SUSPEND_POWER_DOWN) {
-               /* save TICNT for anyone using periodic interrupts */
+       /* save TICNT for anyone using periodic interrupts */
 
-               ticnt_save = readb(S3C2410_TICNT);
+       ticnt_save = readb(S3C2410_TICNT);
 
-               /* calculate time delta for suspend */
+       /* calculate time delta for suspend */
 
-               s3c2410_rtc_gettime(&tm);
-               rtc_tm_to_time(&tm, &time.tv_sec);
-               save_time_delta(&s3c2410_rtc_delta, &time);
-               s3c2410_rtc_enable(dev, 0);
-       }
+       s3c2410_rtc_gettime(&tm);
+       rtc_tm_to_time(&tm, &time.tv_sec);
+       save_time_delta(&s3c2410_rtc_delta, &time);
+       s3c2410_rtc_enable(dev, 0);
 
        return 0;
 }
 
-static int s3c2410_rtc_resume(struct device *dev, u32 level)
+static int s3c2410_rtc_resume(struct device *dev)
 {
        struct rtc_time tm;
        struct timespec time;
index a4873684f22caaa3fcc5ce5112899efeaafc1d5a..f86c15587238e3bfeb0d9d145325375f9a9ca94b 100644 (file)
@@ -1167,19 +1167,17 @@ static int sonypi_disable(void)
 #ifdef CONFIG_PM
 static int old_camera_power;
 
-static int sonypi_suspend(struct device *dev, pm_message_t state, u32 level)
+static int sonypi_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_DISABLE) {
-               old_camera_power = sonypi_device.camera_power;
-               sonypi_disable();
-       }
+       old_camera_power = sonypi_device.camera_power;
+       sonypi_disable();
+
        return 0;
 }
 
-static int sonypi_resume(struct device *dev, u32 level)
+static int sonypi_resume(struct device *dev)
 {
-       if (level == RESUME_ENABLE)
-               sonypi_enable(old_camera_power);
+       sonypi_enable(old_camera_power);
        return 0;
 }
 #endif
index 3625b2601b4257603b6e0b365a012cdc06fbe2a5..b732020acadb1962fa693d5346e97dec33c0acfa 100644 (file)
@@ -464,32 +464,28 @@ static void s3c2410wdt_shutdown(struct device *dev)
 static unsigned long wtcon_save;
 static unsigned long wtdat_save;
 
-static int s3c2410wdt_suspend(struct device *dev, pm_message_t state, u32 level)
+static int s3c2410wdt_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               /* Save watchdog state, and turn it off. */
-               wtcon_save = readl(wdt_base + S3C2410_WTCON);
-               wtdat_save = readl(wdt_base + S3C2410_WTDAT);
+       /* Save watchdog state, and turn it off. */
+       wtcon_save = readl(wdt_base + S3C2410_WTCON);
+       wtdat_save = readl(wdt_base + S3C2410_WTDAT);
 
-               /* Note that WTCNT doesn't need to be saved. */
-               s3c2410wdt_stop();
-       }
+       /* Note that WTCNT doesn't need to be saved. */
+       s3c2410wdt_stop();
 
        return 0;
 }
 
-static int s3c2410wdt_resume(struct device *dev, u32 level)
+static int s3c2410wdt_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               /* Restore watchdog state. */
+       /* Restore watchdog state. */
 
-               writel(wtdat_save, wdt_base + S3C2410_WTDAT);
-               writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
-               writel(wtcon_save, wdt_base + S3C2410_WTCON);
+       writel(wtdat_save, wdt_base + S3C2410_WTDAT);
+       writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */
+       writel(wtcon_save, wdt_base + S3C2410_WTCON);
 
-               printk(KERN_INFO PFX "watchdog %sabled\n",
-                      (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
-       }
+       printk(KERN_INFO PFX "watchdog %sabled\n",
+              (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis");
 
        return 0;
 }
index 7f0107613827bcacc209fbb4f806dba28cdad747..0015da5668a181aa8f9956cc59539c49483c3d95 100644 (file)
@@ -296,11 +296,9 @@ static int hdaps_probe(struct device *dev)
        return 0;
 }
 
-static int hdaps_resume(struct device *dev, u32 level)
+static int hdaps_resume(struct device *dev)
 {
-       if (level == RESUME_ENABLE)
-               return hdaps_device_init();
-       return 0;
+       return hdaps_device_init();
 }
 
 static struct device_driver hdaps_driver = {
index 73a092fb0e7e955411bb2f559c0e92222980716b..69fa282df2d55879a27624ed22cd1a88a3b25df5 100644 (file)
@@ -879,14 +879,12 @@ static int s3c24xx_i2c_remove(struct device *dev)
 }
 
 #ifdef CONFIG_PM
-static int s3c24xx_i2c_resume(struct device *dev, u32 level)
+static int s3c24xx_i2c_resume(struct device *dev)
 {
        struct s3c24xx_i2c *i2c = dev_get_drvdata(dev);
-       
-       if (i2c != NULL && level == RESUME_ENABLE) {
-               dev_dbg(dev, "resume: level %d\n", level);
+
+       if (i2c != NULL)
                s3c24xx_i2c_init(i2c);
-       }
 
        return 0;
 }
index dda472e5e8be3bca0be40f383b2643048c3d0c51..45aa0e54e2972e101d19c7b2051be2b345fdf4ce 100644 (file)
@@ -48,7 +48,7 @@ static int i2c_bus_suspend(struct device * dev, pm_message_t state)
        int rc = 0;
 
        if (dev->driver && dev->driver->suspend)
-               rc = dev->driver->suspend(dev,state,0);
+               rc = dev->driver->suspend(dev, state);
        return rc;
 }
 
@@ -57,7 +57,7 @@ static int i2c_bus_resume(struct device * dev)
        int rc = 0;
        
        if (dev->driver && dev->driver->resume)
-               rc = dev->driver->resume(dev,0);
+               rc = dev->driver->resume(dev);
        return rc;
 }
 
index 347ece6b583c19cdf67e521dcb5ae3ebf2c1ecdd..7fff5a1d2ea4c7abc8713df31f2222a5cfb6c4b2 100644 (file)
@@ -1292,7 +1292,7 @@ static void nodemgr_suspend_ne(struct node_entry *ne)
 
                if (ud->device.driver &&
                    (!ud->device.driver->suspend ||
-                     ud->device.driver->suspend(&ud->device, PMSG_SUSPEND, 0)))
+                     ud->device.driver->suspend(&ud->device, PMSG_SUSPEND)))
                        device_release_driver(&ud->device);
        }
        up_write(&ne->device.bus->subsys.rwsem);
@@ -1315,7 +1315,7 @@ static void nodemgr_resume_ne(struct node_entry *ne)
                        continue;
 
                if (ud->device.driver && ud->device.driver->resume)
-                       ud->device.driver->resume(&ud->device, 0);
+                       ud->device.driver->resume(&ud->device);
        }
        up_read(&ne->device.bus->subsys.rwsem);
 
index 564bb365f6fc586331b26ab41197c345e1607474..3210d298b3bc01d6e984b89097962876cc27db2e 100644 (file)
@@ -259,24 +259,22 @@ static void corgikbd_hinge_timer(unsigned long data)
 }
 
 #ifdef CONFIG_PM
-static int corgikbd_suspend(struct device *dev, pm_message_t state, uint32_t level)
+static int corgikbd_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               struct corgikbd *corgikbd = dev_get_drvdata(dev);
-               corgikbd->suspended = 1;
-       }
+       struct corgikbd *corgikbd = dev_get_drvdata(dev);
+       corgikbd->suspended = 1;
+
        return 0;
 }
 
-static int corgikbd_resume(struct device *dev, uint32_t level)
+static int corgikbd_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               struct corgikbd *corgikbd = dev_get_drvdata(dev);
+       struct corgikbd *corgikbd = dev_get_drvdata(dev);
+
+       /* Upon resume, ignore the suspend key for a short while */
+       corgikbd->suspend_jiffies=jiffies;
+       corgikbd->suspended = 0;
 
-               /* Upon resume, ignore the suspend key for a short while */
-               corgikbd->suspend_jiffies=jiffies;
-               corgikbd->suspended = 0;
-       }
        return 0;
 }
 #else
index 732fb310e487ac0a3cf73a9a06c8241878b7042b..cee9c734a048c9102eaeec0090c99a6e7a8656f0 100644 (file)
@@ -309,34 +309,32 @@ static void spitzkbd_hinge_timer(unsigned long data)
 }
 
 #ifdef CONFIG_PM
-static int spitzkbd_suspend(struct device *dev, pm_message_t state, uint32_t level)
+static int spitzkbd_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               int i;
-               struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
-               spitzkbd->suspended = 1;
-
-               /* Set Strobe lines as inputs - *except* strobe line 0 leave this
-                  enabled so we can detect a power button press for resume */
-               for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++)
-                       pxa_gpio_mode(spitz_strobes[i] | GPIO_IN);
-       }
+       int i;
+       struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
+       spitzkbd->suspended = 1;
+
+       /* Set Strobe lines as inputs - *except* strobe line 0 leave this
+          enabled so we can detect a power button press for resume */
+       for (i = 1; i < SPITZ_KEY_STROBE_NUM; i++)
+               pxa_gpio_mode(spitz_strobes[i] | GPIO_IN);
+
        return 0;
 }
 
-static int spitzkbd_resume(struct device *dev, uint32_t level)
+static int spitzkbd_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               int i;
-               struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
+       int i;
+       struct spitzkbd *spitzkbd = dev_get_drvdata(dev);
+
+       for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++)
+               pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH);
 
-               for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++)
-                       pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH);
+       /* Upon resume, ignore the suspend key for a short while */
+       spitzkbd->suspend_jiffies = jiffies;
+       spitzkbd->suspended = 0;
 
-               /* Upon resume, ignore the suspend key for a short while */
-               spitzkbd->suspend_jiffies = jiffies;
-               spitzkbd->suspended = 0;
-       }
        return 0;
 }
 #else
index 40d451ce07ffecac8052e973e126ae112e256505..4bc40f15999603c5f30e9184575078d5c5a56fcb 100644 (file)
@@ -911,12 +911,10 @@ static long i8042_panic_blink(long count)
  * Here we try to restore the original BIOS settings
  */
 
-static int i8042_suspend(struct device *dev, pm_message_t state, u32 level)
+static int i8042_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_DISABLE) {
-               del_timer_sync(&i8042_timer);
-               i8042_controller_reset();
-       }
+       del_timer_sync(&i8042_timer);
+       i8042_controller_reset();
 
        return 0;
 }
@@ -926,13 +924,10 @@ static int i8042_suspend(struct device *dev, pm_message_t state, u32 level)
  * Here we try to reset everything back to a state in which suspended
  */
 
-static int i8042_resume(struct device *dev, u32 level)
+static int i8042_resume(struct device *dev)
 {
        int i;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        if (i8042_ctl_test())
                return -1;
 
index 40ae183ba1cd840fb705d82550c46119d58a43a7..0ba3e6562bffeb8762230891ed580904a5a6080b 100644 (file)
@@ -231,34 +231,32 @@ static irqreturn_t ts_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 #ifdef CONFIG_PM
-static int corgits_suspend(struct device *dev, pm_message_t state, uint32_t level)
+static int corgits_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
-
-               if (corgi_ts->pendown) {
-                       del_timer_sync(&corgi_ts->timer);
-                       corgi_ts->tc.pressure = 0;
-                       new_data(corgi_ts, NULL);
-                       corgi_ts->pendown = 0;
-               }
-               corgi_ts->power_mode = PWR_MODE_SUSPEND;
+       struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
 
-               corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
+       if (corgi_ts->pendown) {
+               del_timer_sync(&corgi_ts->timer);
+               corgi_ts->tc.pressure = 0;
+               new_data(corgi_ts, NULL);
+               corgi_ts->pendown = 0;
        }
+       corgi_ts->power_mode = PWR_MODE_SUSPEND;
+
+       corgi_ssp_ads7846_putget((1u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
+
        return 0;
 }
 
-static int corgits_resume(struct device *dev, uint32_t level)
+static int corgits_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
+       struct corgi_ts *corgi_ts = dev_get_drvdata(dev);
+
+       corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
+       /* Enable Falling Edge */
+       set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
+       corgi_ts->power_mode = PWR_MODE_ACTIVE;
 
-               corgi_ssp_ads7846_putget((4u << ADSCTRL_ADR_SH) | ADSCTRL_STS);
-               /* Enable Falling Edge */
-               set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
-               corgi_ts->power_mode = PWR_MODE_ACTIVE;
-       }
        return 0;
 }
 #else
index f0d43fc2632f35db99f404d04cc42ef50a4f2818..262890cb20a7daf55de5d25d6840db40a6eb9dc3 100644 (file)
@@ -1420,8 +1420,8 @@ static int msp_detach(struct i2c_client *client);
 static int msp_probe(struct i2c_adapter *adap);
 static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
 
-static int msp_suspend(struct device * dev, pm_message_t state, u32 level);
-static int msp_resume(struct device * dev, u32 level);
+static int msp_suspend(struct device * dev, pm_message_t state);
+static int msp_resume(struct device * dev);
 
 static void msp_wake_thread(struct i2c_client *client);
 
@@ -1821,7 +1821,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
+static int msp_suspend(struct device * dev, pm_message_t state)
 {
        struct i2c_client *c = container_of(dev, struct i2c_client, dev);
 
@@ -1830,7 +1830,7 @@ static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int msp_resume(struct device * dev, u32 level)
+static int msp_resume(struct device * dev)
 {
        struct i2c_client *c = container_of(dev, struct i2c_client, dev);
 
index 0456dda2624ddc5f487e0523c0926ee926c78dad..94053f149ddf57f1bbfd16f39cd6dca6abab77cf 100644 (file)
@@ -784,13 +784,13 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level)
+static int tda9887_suspend(struct device * dev, pm_message_t state)
 {
        dprintk("tda9887: suspend\n");
        return 0;
 }
 
-static int tda9887_resume(struct device * dev, u32 level)
+static int tda9887_resume(struct device * dev)
 {
        struct i2c_client *c = container_of(dev, struct i2c_client, dev);
        struct tda9887 *t = i2c_get_clientdata(c);
index 05572020af4d03a944bd317064272b2041d231d9..ad85bef1c3d5d20bcd256704ea868352fd3fca1f 100644 (file)
@@ -697,7 +697,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int tuner_suspend(struct device *dev, pm_message_t state, u32 level)
+static int tuner_suspend(struct device *dev, pm_message_t state)
 {
        struct i2c_client *c = container_of (dev, struct i2c_client, dev);
        struct tuner *t = i2c_get_clientdata (c);
@@ -707,7 +707,7 @@ static int tuner_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int tuner_resume(struct device *dev, u32 level)
+static int tuner_resume(struct device *dev)
 {
        struct i2c_client *c = container_of (dev, struct i2c_client, dev);
        struct tuner *t = i2c_get_clientdata (c);
index e9806fbbe696308cffc111e6f48788c866f1bd9d..720e7a3263088b881dce613e958af67f0f243586 100644 (file)
@@ -219,26 +219,24 @@ static int mcp_sa11x0_remove(struct device *dev)
        return 0;
 }
 
-static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state, u32 level)
+static int mcp_sa11x0_suspend(struct device *dev, pm_message_t state)
 {
        struct mcp *mcp = dev_get_drvdata(dev);
 
-       if (level == SUSPEND_DISABLE) {
-               priv(mcp)->mccr0 = Ser4MCCR0;
-               priv(mcp)->mccr1 = Ser4MCCR1;
-               Ser4MCCR0 &= ~MCCR0_MCE;
-       }
+       priv(mcp)->mccr0 = Ser4MCCR0;
+       priv(mcp)->mccr1 = Ser4MCCR1;
+       Ser4MCCR0 &= ~MCCR0_MCE;
+
        return 0;
 }
 
-static int mcp_sa11x0_resume(struct device *dev, u32 level)
+static int mcp_sa11x0_resume(struct device *dev)
 {
        struct mcp *mcp = dev_get_drvdata(dev);
 
-       if (level == RESUME_RESTORE_STATE) {
-               Ser4MCCR1 = priv(mcp)->mccr1;
-               Ser4MCCR0 = priv(mcp)->mccr0;
-       }
+       Ser4MCCR1 = priv(mcp)->mccr1;
+       Ser4MCCR0 = priv(mcp)->mccr0;
+
        return 0;
 }
 
index b53af57074e3296b5bf994c105f37a42b3a8398a..8eba373d42d70ff91f0e1b37b37da8d9bda2d217 100644 (file)
@@ -571,23 +571,23 @@ static int pxamci_remove(struct device *dev)
 }
 
 #ifdef CONFIG_PM
-static int pxamci_suspend(struct device *dev, pm_message_t state, u32 level)
+static int pxamci_suspend(struct device *dev, pm_message_t state)
 {
        struct mmc_host *mmc = dev_get_drvdata(dev);
        int ret = 0;
 
-       if (mmc && level == SUSPEND_DISABLE)
+       if (mmc)
                ret = mmc_suspend_host(mmc, state);
 
        return ret;
 }
 
-static int pxamci_resume(struct device *dev, u32 level)
+static int pxamci_resume(struct device *dev)
 {
        struct mmc_host *mmc = dev_get_drvdata(dev);
        int ret = 0;
 
-       if (mmc && level == RESUME_ENABLE)
+       if (mmc)
                ret = mmc_resume_host(mmc);
 
        return ret;
index 3cbca7cbea801798bb7a1c7fb05462ed98fb89dd..25f7ce7b3bc08ea1038ac99ef4b8c48e26c82057 100644 (file)
@@ -1955,14 +1955,14 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev)
  */
 
 #ifdef CONFIG_PM
-static int wbsd_suspend(struct device *dev, pm_message_t state, u32 level)
+static int wbsd_suspend(struct device *dev, pm_message_t state)
 {
        DBGF("Not yet supported\n");
 
        return 0;
 }
 
-static int wbsd_resume(struct device *dev, u32 level)
+static int wbsd_resume(struct device *dev)
 {
        DBGF("Not yet supported\n");
 
index 8dcaa357b4bb13bbaba9e543f1b45dc49ce880b3..55f21ddec3df16847cdd9e2136e86474b82c1b74 100644 (file)
@@ -402,21 +402,21 @@ static int __exit sa1100_mtd_remove(struct device *dev)
 }
 
 #ifdef CONFIG_PM
-static int sa1100_mtd_suspend(struct device *dev, pm_message_t state, u32 level)
+static int sa1100_mtd_suspend(struct device *dev, pm_message_t state)
 {
        struct sa_info *info = dev_get_drvdata(dev);
        int ret = 0;
 
-       if (info && level == SUSPEND_SAVE_STATE)
+       if (info)
                ret = info->mtd->suspend(info->mtd);
 
        return ret;
 }
 
-static int sa1100_mtd_resume(struct device *dev, u32 level)
+static int sa1100_mtd_resume(struct device *dev)
 {
        struct sa_info *info = dev_get_drvdata(dev);
-       if (info && level == RESUME_RESTORE_STATE)
+       if (info)
                info->mtd->resume(info->mtd);
        return 0;
 }
index e54fc10f68467c7fd9bf92e11b9fb9d3fba3cee4..abce1f730d00b32df657af0bbbca5525e903eb51 100644 (file)
@@ -1140,11 +1140,11 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
 }
 
 static int
-dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level)
+dm9000_drv_suspend(struct device *dev, pm_message_t state)
 {
        struct net_device *ndev = dev_get_drvdata(dev);
 
-       if (ndev && level == SUSPEND_DISABLE) {
+       if (ndev) {
                if (netif_running(ndev)) {
                        netif_device_detach(ndev);
                        dm9000_shutdown(ndev);
@@ -1154,12 +1154,12 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state, u32 level)
 }
 
 static int
-dm9000_drv_resume(struct device *dev, u32 level)
+dm9000_drv_resume(struct device *dev)
 {
        struct net_device *ndev = dev_get_drvdata(dev);
        board_info_t *db = (board_info_t *) ndev->priv;
 
-       if (ndev && level == RESUME_ENABLE) {
+       if (ndev) {
 
                if (netif_running(ndev)) {
                        dm9000_reset(db);
index 8d34ac60d90679ea54c2c3c48a9db6a3dbce146c..06883309916d493636097dddc1e5b15e93359cf5 100644 (file)
@@ -291,12 +291,12 @@ static void sa1100_irda_shutdown(struct sa1100_irda *si)
 /*
  * Suspend the IrDA interface.
  */
-static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 level)
+static int sa1100_irda_suspend(struct device *_dev, pm_message_t state)
 {
        struct net_device *dev = dev_get_drvdata(_dev);
        struct sa1100_irda *si;
 
-       if (!dev || level != SUSPEND_DISABLE)
+       if (!dev)
                return 0;
 
        si = dev->priv;
@@ -316,12 +316,12 @@ static int sa1100_irda_suspend(struct device *_dev, pm_message_t state, u32 leve
 /*
  * Resume the IrDA interface.
  */
-static int sa1100_irda_resume(struct device *_dev, u32 level)
+static int sa1100_irda_resume(struct device *_dev)
 {
        struct net_device *dev = dev_get_drvdata(_dev);
        struct sa1100_irda *si;
 
-       if (!dev || level != RESUME_ENABLE)
+       if (!dev)
                return 0;
 
        si = dev->priv;
index dd89bda1f1315914349fe692029108b30dd6262a..bbac720cca63d9cfc02231e07bdc4d0a0413e706 100644 (file)
@@ -213,8 +213,8 @@ static int  smsc_ircc_probe_transceiver_smsc_ircc_atc(int fir_base);
 
 /* Power Management */
 
-static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level);
-static int smsc_ircc_resume(struct device *dev, u32 level);
+static int smsc_ircc_suspend(struct device *dev, pm_message_t state);
+static int smsc_ircc_resume(struct device *dev);
 
 static struct device_driver smsc_ircc_driver = {
        .name           = SMSC_IRCC2_DRIVER_NAME,
@@ -1646,13 +1646,13 @@ static int smsc_ircc_net_close(struct net_device *dev)
        return 0;
 }
 
-static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level)
+static int smsc_ircc_suspend(struct device *dev, pm_message_t state)
 {
        struct smsc_ircc_cb *self = dev_get_drvdata(dev);
 
        IRDA_MESSAGE("%s, Suspending\n", driver_name);
 
-       if (level == SUSPEND_DISABLE && !self->io.suspended) {
+       if (!self->io.suspended) {
                smsc_ircc_net_close(self->netdev);
                self->io.suspended = 1;
        }
@@ -1660,11 +1660,11 @@ static int smsc_ircc_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int smsc_ircc_resume(struct device *dev, u32 level)
+static int smsc_ircc_resume(struct device *dev)
 {
        struct smsc_ircc_cb *self = dev_get_drvdata(dev);
 
-       if (level == RESUME_ENABLE && self->io.suspended) {
+       if (self->io.suspended) {
 
                smsc_ircc_net_open(self->netdev);
                self->io.suspended = 0;
index 90630672703d1c1886e169b4e718d44c0357899b..ad93b0da87f020b2e4c1de55f9de52db271bc089 100644 (file)
@@ -133,13 +133,9 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state)
        int ret = 0;
        struct device_driver *drv = dev->driver;
 
-       if (drv && drv->suspend) {
-               ret = drv->suspend(dev, state, SUSPEND_DISABLE);
-               if (ret == 0)
-                       ret = drv->suspend(dev, state, SUSPEND_SAVE_STATE);
-               if (ret == 0)
-                       ret = drv->suspend(dev, state, SUSPEND_POWER_DOWN);
-       }
+       if (drv && drv->suspend)
+               ret = drv->suspend(dev, state);
+
        return ret;
 }
 
@@ -148,13 +144,9 @@ static int mdio_bus_resume(struct device * dev)
        int ret = 0;
        struct device_driver *drv = dev->driver;
 
-       if (drv && drv->resume) {
-               ret = drv->resume(dev, RESUME_POWER_ON);
-               if (ret == 0)
-                       ret = drv->resume(dev, RESUME_RESTORE_STATE);
-               if (ret == 0)
-                       ret = drv->resume(dev, RESUME_ENABLE);
-       }
+       if (drv && drv->resume)
+               ret = drv->resume(dev);
+
        return ret;
 }
 
index 1438fdd20826487a0d8d0535143f484b1111a3be..0ddaa611cc61657d424a3cc42313aac2b6916406 100644 (file)
@@ -2291,11 +2291,11 @@ static int smc_drv_remove(struct device *dev)
        return 0;
 }
 
-static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level)
+static int smc_drv_suspend(struct device *dev, pm_message_t state)
 {
        struct net_device *ndev = dev_get_drvdata(dev);
 
-       if (ndev && level == SUSPEND_DISABLE) {
+       if (ndev) {
                if (netif_running(ndev)) {
                        netif_device_detach(ndev);
                        smc_shutdown(ndev);
@@ -2305,12 +2305,12 @@ static int smc_drv_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int smc_drv_resume(struct device *dev, u32 level)
+static int smc_drv_resume(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
        struct net_device *ndev = dev_get_drvdata(dev);
 
-       if (ndev && level == RESUME_ENABLE) {
+       if (ndev) {
                struct smc_local *lp = netdev_priv(ndev);
                smc_enable_device(pdev);
                if (netif_running(ndev)) {
index 393e0cee91a93cfb50e518c02909605943ed57c2..14f05d22bb70bc62adc63a5263eec5a278d32f32 100644 (file)
@@ -61,7 +61,7 @@ static int pcie_port_remove_service(struct device *dev)
 
 static void pcie_port_shutdown_service(struct device *dev) {}
 
-static int pcie_port_suspend_service(struct device *dev, pm_message_t state, u32 level)
+static int pcie_port_suspend_service(struct device *dev, pm_message_t state)
 {
        struct pcie_device *pciedev;
        struct pcie_port_service_driver *driver;
@@ -76,7 +76,7 @@ static int pcie_port_suspend_service(struct device *dev, pm_message_t state, u32
        return 0;
 }
 
-static int pcie_port_resume_service(struct device *dev, u32 level)
+static int pcie_port_resume_service(struct device *dev)
 {
        struct pcie_device *pciedev;
        struct pcie_port_service_driver *driver;
index 470ef756252eb23067323fb8f8d354f553050cf9..d90a634cebf5acc6d6152d5f2ddb66cf219bf7f7 100644 (file)
@@ -519,30 +519,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
 }
 
 
-static int au1x00_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int au1x00_drv_pcmcia_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
-
 static struct device_driver au1x00_pcmcia_driver = {
        .probe          = au1x00_drv_pcmcia_probe,
        .remove         = au1x00_drv_pcmcia_remove,
        .name           = "au1x00-pcmcia",
        .bus            = &platform_bus_type,
-       .suspend        = au1x00_drv_pcmcia_suspend,
-       .resume         = au1x00_drv_pcmcia_resume
+       .suspend        = pcmcia_socket_dev_suspend,
+       .resume         = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device au1x00_device = {
index 316f8bcc878be674fa22cba22e4781b14fc3ec43..b57a0b98b4d6b89c521c9172463b3ffc342f9aec 100644 (file)
@@ -844,27 +844,11 @@ static void hs_exit_socket(hs_socket_t *sp)
        local_irq_restore(flags);
 }
 
-static int hd64465_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int hd64465_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
 static struct device_driver hd64465_driver = {
        .name = "hd64465-pcmcia",
        .bus = &platform_bus_type,
-       .suspend = hd64465_suspend,
-       .resume = hd64465_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device hd64465_device = {
index a713015e8228cb48321fa227ceda4db9a1eed7ef..4a41f67d185d9f5b181ced34f110d627433f2ce3 100644 (file)
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = {
 
 /*====================================================================*/
 
-static int i82365_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int i82365_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
 static struct device_driver i82365_driver = {
        .name = "i82365",
        .bus = &platform_bus_type,
-       .suspend = i82365_suspend,
-       .resume = i82365_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device i82365_device = {
index 65f3ee3d4d3c6ea48b76c5b9d052186ad74f8b1c..c6ed70ea4812ec557a41d65469e31180c775cfc8 100644 (file)
@@ -731,28 +731,11 @@ static struct pccard_operations pcc_operations = {
 
 /*====================================================================*/
 
-static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int m32r_pcc_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
-
 static struct device_driver pcc_driver = {
        .name = "cfc",
        .bus = &platform_bus_type,
-       .suspend = m32r_pcc_suspend,
-       .resume = m32r_pcc_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device pcc_device = {
index 7b14d7efd68c0632d08ad35b273730bd625bc5d1..3397ff28de6aa7897963dd3d6a64f8e68483f821 100644 (file)
@@ -695,28 +695,11 @@ static struct pccard_operations pcc_operations = {
 
 /*====================================================================*/
 
-static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int m32r_pcc_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
-
 static struct device_driver pcc_driver = {
        .name = "pcc",
        .bus = &platform_bus_type,
-       .suspend = m32r_pcc_suspend,
-       .resume = m32r_pcc_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device pcc_device = {
index 94be9e51654e39da4ac7ab5694eb7bc9b89723a3..2558c3cc91eca9eef0a6239c402a8c1afcbb092e 100644 (file)
@@ -329,27 +329,13 @@ static int __devexit omap_cf_remove(struct device *dev)
        return 0;
 }
 
-static int omap_cf_suspend(struct device *dev, pm_message_t mesg, u32 level)
-{
-       if (level != SUSPEND_SAVE_STATE)
-               return 0;
-       return pcmcia_socket_dev_suspend(dev, mesg);
-}
-
-static int omap_cf_resume(struct device *dev, u32 level)
-{
-       if (level != RESUME_RESTORE_STATE)
-               return 0;
-       return pcmcia_socket_dev_resume(dev);
-}
-
 static struct device_driver omap_cf_driver = {
        .name           = (char *) driver_name,
        .bus            = &platform_bus_type,
        .probe          = omap_cf_probe,
        .remove         = __devexit_p(omap_cf_remove),
-       .suspend        = omap_cf_suspend,
-       .resume         = omap_cf_resume,
+       .suspend        = pcmcia_socket_dev_suspend,
+       .resume         = pcmcia_socket_dev_resume,
 };
 
 static int __init omap_cf_init(void)
index 325c992f7d8f3804726e5024d85101919225a3cb..c2a12d53f6c76e9afd8341174db3bb40b79f47c2 100644 (file)
@@ -205,32 +205,20 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev)
 }
 EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe);
 
-static int pxa2xx_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
+static int pxa2xx_drv_pcmcia_resume(struct device *dev)
 {
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
+       struct pcmcia_low_level *ops = dev->platform_data;
+       int nr = ops ? ops->nr : 0;
 
-static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-       {
-               struct pcmcia_low_level *ops = dev->platform_data;
-               int nr = ops ? ops->nr : 0;
-
-               MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
-               ret = pcmcia_socket_dev_resume(dev);
-       }
-       return ret;
+       MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
+
+       return pcmcia_socket_dev_resume(dev);
 }
 
 static struct device_driver pxa2xx_pcmcia_driver = {
        .probe          = pxa2xx_drv_pcmcia_probe,
        .remove         = soc_common_drv_pcmcia_remove,
-       .suspend        = pxa2xx_drv_pcmcia_suspend,
+       .suspend        = pcmcia_socket_dev_suspend,
        .resume         = pxa2xx_drv_pcmcia_resume,
        .name           = "pxa2xx-pcmcia",
        .bus            = &platform_bus_type,
index d4ed508b38be5ea07f2ca96e0064a27e3896136b..b768fa81f043f40693b59aed01c9e1180163b0e1 100644 (file)
@@ -74,29 +74,13 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev)
        return ret;
 }
 
-static int sa11x0_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
 static struct device_driver sa11x0_pcmcia_driver = {
        .probe          = sa11x0_drv_pcmcia_probe,
        .remove         = soc_common_drv_pcmcia_remove,
        .name           = "sa11x0-pcmcia",
        .bus            = &platform_bus_type,
-       .suspend        = sa11x0_drv_pcmcia_suspend,
-       .resume         = sa11x0_drv_pcmcia_resume,
+       .suspend        = pcmcia_socket_dev_suspend,
+       .resume         = pcmcia_socket_dev_resume,
 };
 
 /* sa11x0_pcmcia_init()
index d5a61eae61194a8f3f3cc8f11ff278c3e61ad1da..f158b67f661007c7b9a1ef64fd55a08f9f70d154 100644 (file)
@@ -372,27 +372,11 @@ static int __init get_tcic_id(void)
 
 /*====================================================================*/
 
-static int tcic_drv_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int ret = 0;
-       if (level == SUSPEND_SAVE_STATE)
-               ret = pcmcia_socket_dev_suspend(dev, state);
-       return ret;
-}
-
-static int tcic_drv_resume(struct device *dev, u32 level)
-{
-       int ret = 0;
-       if (level == RESUME_RESTORE_STATE)
-               ret = pcmcia_socket_dev_resume(dev);
-       return ret;
-}
-
 static struct device_driver tcic_driver = {
        .name = "tcic-pcmcia",
        .bus = &platform_bus_type,
-       .suspend = tcic_drv_suspend,
-       .resume = tcic_drv_resume,
+       .suspend = pcmcia_socket_dev_suspend,
+       .resume = pcmcia_socket_dev_resume,
 };
 
 static struct platform_device tcic_device = {
index 17bb2da6752bc08f0eeeaffa074490f4211c4d5c..3d2dca675e02bc9483b8b8828d2ee948f7e6f52c 100644 (file)
@@ -774,31 +774,11 @@ static int __devinit vrc4171_card_setup(char *options)
 
 __setup("vrc4171_card=", vrc4171_card_setup);
 
-static int vrc4171_card_suspend(struct device *dev, pm_message_t state, u32 level)
-{
-       int retval = 0;
-
-       if (level == SUSPEND_SAVE_STATE)
-               retval = pcmcia_socket_dev_suspend(dev, state);
-
-       return retval;
-}
-
-static int vrc4171_card_resume(struct device *dev, u32 level)
-{
-       int retval = 0;
-
-       if (level == RESUME_RESTORE_STATE)
-               retval = pcmcia_socket_dev_resume(dev);
-
-       return retval;
-}
-
 static struct device_driver vrc4171_card_driver = {
        .name           = vrc4171_card_name,
        .bus            = &platform_bus_type,
-       .suspend        = vrc4171_card_suspend,
-       .resume         = vrc4171_card_resume,
+       .suspend        = pcmcia_socket_dev_suspend,
+       .resume         = pcmcia_socket_dev_resume,
 };
 
 static int __devinit vrc4171_card_init(void)
index 4d75cdfa0a0af00bd928faae571008dcbac4d0a2..afb7ddf200e082d8ee6032095f50db6b4dcdd771 100644 (file)
@@ -2358,13 +2358,10 @@ static int __devexit serial8250_remove(struct device *dev)
        return 0;
 }
 
-static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level)
+static int serial8250_suspend(struct device *dev, pm_message_t state)
 {
        int i;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        for (i = 0; i < UART_NR; i++) {
                struct uart_8250_port *up = &serial8250_ports[i];
 
@@ -2375,13 +2372,10 @@ static int serial8250_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int serial8250_resume(struct device *dev, u32 level)
+static int serial8250_resume(struct device *dev)
 {
        int i;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        for (i = 0; i < UART_NR; i++) {
                struct uart_8250_port *up = &serial8250_ports[i];
 
index bdb4e454b8b07311a8a76597f768572f38afa476..5b3933b0c997f011897585c3cca97fd8b357c2dc 100644 (file)
@@ -921,21 +921,21 @@ static struct uart_driver imx_reg = {
        .cons           = IMX_CONSOLE,
 };
 
-static int serial_imx_suspend(struct device *_dev, pm_message_t state, u32 level)
+static int serial_imx_suspend(struct device *_dev, pm_message_t state)
 {
         struct imx_port *sport = dev_get_drvdata(_dev);
 
-        if (sport && level == SUSPEND_DISABLE)
+        if (sport)
                 uart_suspend_port(&imx_reg, &sport->port);
 
         return 0;
 }
 
-static int serial_imx_resume(struct device *_dev, u32 level)
+static int serial_imx_resume(struct device *_dev)
 {
         struct imx_port *sport = dev_get_drvdata(_dev);
 
-        if (sport && level == RESUME_ENABLE)
+        if (sport)
                 uart_resume_port(&imx_reg, &sport->port);
 
         return 0;
index 0585ab27ffde7da5ba9070badb87dc2891d40e10..8a79968f8ce1f27b337bbdd21dc0b62c14a241d6 100644 (file)
@@ -781,22 +781,22 @@ mpc52xx_uart_remove(struct device *dev)
 
 #ifdef CONFIG_PM
 static int
-mpc52xx_uart_suspend(struct device *dev, pm_message_t state, u32 level)
+mpc52xx_uart_suspend(struct device *dev, pm_message_t state)
 {
        struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev);
 
-       if (sport && level == SUSPEND_DISABLE)
+       if (sport)
                uart_suspend_port(&mpc52xx_uart_driver, port);
 
        return 0;
 }
 
 static int
-mpc52xx_uart_resume(struct device *dev, u32 level)
+mpc52xx_uart_resume(struct device *dev)
 {
        struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev);
 
-       if (port && level == RESUME_ENABLE)
+       if (port)
                uart_resume_port(&mpc52xx_uart_driver, port);
 
        return 0;
index 90c2a86c421b0cb3f8cb22eed95a120671d982d9..7999686d7b47420fe787a7f1d49e00e0fecd04ee 100644 (file)
@@ -786,21 +786,21 @@ static struct uart_driver serial_pxa_reg = {
        .cons           = PXA_CONSOLE,
 };
 
-static int serial_pxa_suspend(struct device *_dev, pm_message_t state, u32 level)
+static int serial_pxa_suspend(struct device *_dev, pm_message_t state)
 {
         struct uart_pxa_port *sport = dev_get_drvdata(_dev);
 
-        if (sport && level == SUSPEND_DISABLE)
+        if (sport)
                 uart_suspend_port(&serial_pxa_reg, &sport->port);
 
         return 0;
 }
 
-static int serial_pxa_resume(struct device *_dev, u32 level)
+static int serial_pxa_resume(struct device *_dev)
 {
         struct uart_pxa_port *sport = dev_get_drvdata(_dev);
 
-        if (sport && level == RESUME_ENABLE)
+        if (sport)
                 uart_resume_port(&serial_pxa_reg, &sport->port);
 
         return 0;
index 52692aa345ecfec1fecff5a3aba6ccc820384c80..06a17dff1a7316d45e2d2f729b98b99e86a8bb29 100644 (file)
@@ -1134,23 +1134,22 @@ static int s3c24xx_serial_remove(struct device *_dev)
 
 #ifdef CONFIG_PM
 
-static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state,
-                                 u32 level)
+static int s3c24xx_serial_suspend(struct device *dev, pm_message_t state)
 {
        struct uart_port *port = s3c24xx_dev_to_port(dev);
 
-       if (port && level == SUSPEND_DISABLE)
+       if (port)
                uart_suspend_port(&s3c24xx_uart_drv, port);
 
        return 0;
 }
 
-static int s3c24xx_serial_resume(struct device *dev, u32 level)
+static int s3c24xx_serial_resume(struct device *dev)
 {
        struct uart_port *port = s3c24xx_dev_to_port(dev);
        struct s3c24xx_uart_port *ourport = to_ourport(port);
 
-       if (port && level == RESUME_ENABLE) {
+       if (port) {
                clk_enable(ourport->clk);
                s3c24xx_serial_resetport(port, s3c24xx_port_to_cfg(port));
                clk_disable(ourport->clk);
index dd8aed242357c77e2043b53248c7ff00ec1cfaa8..c4a789e6af447f3c7d111409cc39972f9df1c479 100644 (file)
@@ -834,21 +834,21 @@ static struct uart_driver sa1100_reg = {
        .cons                   = SA1100_CONSOLE,
 };
 
-static int sa1100_serial_suspend(struct device *_dev, pm_message_t state, u32 level)
+static int sa1100_serial_suspend(struct device *_dev, pm_message_t state)
 {
        struct sa1100_port *sport = dev_get_drvdata(_dev);
 
-       if (sport && level == SUSPEND_DISABLE)
+       if (sport)
                uart_suspend_port(&sa1100_reg, &sport->port);
 
        return 0;
 }
 
-static int sa1100_serial_resume(struct device *_dev, u32 level)
+static int sa1100_serial_resume(struct device *_dev)
 {
        struct sa1100_port *sport = dev_get_drvdata(_dev);
 
-       if (sport && level == RESUME_ENABLE)
+       if (sport)
                uart_resume_port(&sa1100_reg, &sport->port);
 
        return 0;
index 0c5d65a08f6e01e4d84e33d8adc042a85ed58b6e..2b623ab0e36ec99f64373133e71ba907fe9b9f1b 100644 (file)
@@ -976,14 +976,11 @@ static int siu_remove(struct device *dev)
        return 0;
 }
 
-static int siu_suspend(struct device *dev, pm_message_t state, u32 level)
+static int siu_suspend(struct device *dev, pm_message_t state)
 {
        struct uart_port *port;
        int i;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        for (i = 0; i < siu_uart_driver.nr; i++) {
                port = &siu_uart_ports[i];
                if ((port->type == PORT_VR41XX_SIU ||
@@ -995,14 +992,11 @@ static int siu_suspend(struct device *dev, pm_message_t state, u32 level)
        return 0;
 }
 
-static int siu_resume(struct device *dev, u32 level)
+static int siu_resume(struct device *dev)
 {
        struct uart_port *port;
        int i;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        for (i = 0; i < siu_uart_driver.nr; i++) {
                port = &siu_uart_ports[i];
                if ((port->type == PORT_VR41XX_SIU ||
index 583db7c38cf192e7751eeacea3f8994ad8677803..f2bdf4e1eb800bbf7ada981bafe677cd728f640a 100644 (file)
@@ -935,14 +935,10 @@ static int dummy_udc_remove (struct device *dev)
        return 0;
 }
 
-static int dummy_udc_suspend (struct device *dev, pm_message_t state,
-               u32 level)
+static int dummy_udc_suspend (struct device *dev, pm_message_t state)
 {
        struct dummy    *dum = dev_get_drvdata(dev);
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        dev_dbg (dev, "%s\n", __FUNCTION__);
        spin_lock_irq (&dum->lock);
        dum->udc_suspended = 1;
@@ -954,13 +950,10 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state,
        return 0;
 }
 
-static int dummy_udc_resume (struct device *dev, u32 level)
+static int dummy_udc_resume (struct device *dev)
 {
        struct dummy    *dum = dev_get_drvdata(dev);
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        dev_dbg (dev, "%s\n", __FUNCTION__);
        spin_lock_irq (&dum->lock);
        dum->udc_suspended = 0;
@@ -1936,14 +1929,10 @@ static int dummy_hcd_remove (struct device *dev)
        return 0;
 }
 
-static int dummy_hcd_suspend (struct device *dev, pm_message_t state,
-               u32 level)
+static int dummy_hcd_suspend (struct device *dev, pm_message_t state)
 {
        struct usb_hcd          *hcd;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        dev_dbg (dev, "%s\n", __FUNCTION__);
        hcd = dev_get_drvdata (dev);
 
@@ -1958,13 +1947,10 @@ static int dummy_hcd_suspend (struct device *dev, pm_message_t state,
        return 0;
 }
 
-static int dummy_hcd_resume (struct device *dev, u32 level)
+static int dummy_hcd_resume (struct device *dev)
 {
        struct usb_hcd          *hcd;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        dev_dbg (dev, "%s\n", __FUNCTION__);
        hcd = dev_get_drvdata (dev);
        hcd->state = HC_STATE_RUNNING;
index ff5533e6956047fd25688d3fd37af3f23421b38f..58b3ec97fb9a730ccf6c207aa9b510fe6e3c14b6 100644 (file)
@@ -2909,12 +2909,10 @@ static int __exit omap_udc_remove(struct device *dev)
  * may involve talking to an external transceiver (e.g. isp1301).
  */
 
-static int omap_udc_suspend(struct device *dev, pm_message_t message, u32 level)
+static int omap_udc_suspend(struct device *dev, pm_message_t message)
 {
        u32     devstat;
 
-       if (level != SUSPEND_POWER_DOWN)
-               return 0;
        devstat = UDC_DEVSTAT_REG;
 
        /* we're requesting 48 MHz clock if the pullup is enabled
@@ -2931,11 +2929,8 @@ static int omap_udc_suspend(struct device *dev, pm_message_t message, u32 level)
        return 0;
 }
 
-static int omap_udc_resume(struct device *dev, u32 level)
+static int omap_udc_resume(struct device *dev)
 {
-       if (level != RESUME_POWER_ON)
-               return 0;
-
        DBG("resume + wakeup/SRP\n");
        omap_pullup(&udc->gadget, 1);
 
index 73f8c9404156be4f6d2afa9351d8bd20a14e1bf6..00dfe42d7a86d8a39d3ab9a79cc89c2405df7e7e 100644 (file)
@@ -2602,24 +2602,23 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
  * VBUS IRQs should probably be ignored so that the PXA device just acts
  * "dead" to USB hosts until system resume.
  */
-static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state, u32 level)
+static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state)
 {
        struct pxa2xx_udc       *udc = dev_get_drvdata(dev);
 
-       if (level == SUSPEND_POWER_DOWN) {
-               if (!udc->mach->udc_command)
-                       WARN("USB host won't detect disconnect!\n");
-               pullup(udc, 0);
-       }
+       if (!udc->mach->udc_command)
+               WARN("USB host won't detect disconnect!\n");
+       pullup(udc, 0);
+
        return 0;
 }
 
-static int pxa2xx_udc_resume(struct device *dev, u32 level)
+static int pxa2xx_udc_resume(struct device *dev)
 {
        struct pxa2xx_udc       *udc = dev_get_drvdata(dev);
 
-       if (level == RESUME_POWER_ON)
-               pullup(udc, 1);
+       pullup(udc, 1);
+
        return 0;
 }
 
index e142056b0d2cd5fc8c46e267564cc1ed2318033b..0f6183a829c4438e69ba66a072d05c124f946834 100644 (file)
@@ -1774,15 +1774,12 @@ static int __init isp116x_probe(struct device *dev)
 /*
   Suspend of platform device
 */
-static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase)
+static int isp116x_suspend(struct device *dev, pm_message_t state)
 {
        int ret = 0;
        struct usb_hcd *hcd = dev_get_drvdata(dev);
 
-       VDBG("%s: state %x, phase %x\n", __func__, state, phase);
-
-       if (phase != SUSPEND_DISABLE && phase != SUSPEND_POWER_DOWN)
-               return 0;
+       VDBG("%s: state %x\n", __func__, state);
 
        ret = usb_suspend_device(hcd->self.root_hub, state);
        if (!ret) {
@@ -1797,15 +1794,12 @@ static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase)
 /*
   Resume platform device
 */
-static int isp116x_resume(struct device *dev, u32 phase)
+static int isp116x_resume(struct device *dev)
 {
        int ret = 0;
        struct usb_hcd *hcd = dev_get_drvdata(dev);
 
-       VDBG("%s:  state %x, phase %x\n", __func__, dev->power.power_state,
-            phase);
-       if (phase != RESUME_POWER_ON)
-               return 0;
+       VDBG("%s:  state %x\n", __func__, dev->power.power_state);
 
        ret = usb_resume_device(hcd->self.root_hub);
        if (!ret) {
index d8f3ba7ad52e2d9309da74ff0fb8badcdf0f239d..a574216625a03c7d84f443aa31f9ab4fec9a6f85 100644 (file)
@@ -455,14 +455,11 @@ static int ohci_hcd_omap_drv_remove(struct device *dev)
 
 #ifdef CONFIG_PM
 
-static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level)
+static int ohci_omap_suspend(struct device *dev, pm_message_t message)
 {
        struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));
        int             status = -EINVAL;
 
-       if (level != SUSPEND_POWER_DOWN)
-               return 0;
-
        down(&ohci_to_hcd(ohci)->self.root_hub->serialize);
        status = ohci_hub_suspend(ohci_to_hcd(ohci));
        if (status == 0) {
@@ -476,14 +473,11 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message, u32 level
        return status;
 }
 
-static int ohci_omap_resume(struct device *dev, u32 level)
+static int ohci_omap_resume(struct device *dev)
 {
        struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev));
        int             status = 0;
 
-       if (level != RESUME_POWER_ON)
-               return 0;
-
        if (time_before(jiffies, ohci->next_statechange))
                msleep(5);
        ohci->next_statechange = jiffies;
index 2fdb262d47260afb3d3b37cb25306b0f21df3168..f042261ecb8e95e881de526b9a32ae6b89331b89 100644 (file)
@@ -309,7 +309,7 @@ static int ohci_hcd_pxa27x_drv_remove(struct device *dev)
        return 0;
 }
 
-static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u32 level)
+static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state)
 {
 //     struct platform_device *pdev = to_platform_device(dev);
 //     struct usb_hcd *hcd = dev_get_drvdata(dev);
@@ -318,7 +318,7 @@ static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state, u
        return 0;
 }
 
-static int ohci_hcd_pxa27x_drv_resume(struct device *dev, u32 level)
+static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
 {
 //     struct platform_device *pdev = to_platform_device(dev);
 //     struct usb_hcd *hcd = dev_get_drvdata(dev);
index d42a15d10a462de96a4ba16869990f4ae41f1057..03cf6accfe649ea073a48b12ebfc9c19250cca60 100644 (file)
@@ -1784,15 +1784,12 @@ sl811h_probe(struct device *dev)
  */
 
 static int
-sl811h_suspend(struct device *dev, pm_message_t state, u32 phase)
+sl811h_suspend(struct device *dev, pm_message_t state)
 {
        struct usb_hcd  *hcd = dev_get_drvdata(dev);
        struct sl811    *sl811 = hcd_to_sl811(hcd);
        int             retval = 0;
 
-       if (phase != SUSPEND_POWER_DOWN)
-               return retval;
-
        if (state.event == PM_EVENT_FREEZE)
                retval = sl811h_hub_suspend(hcd);
        else if (state.event == PM_EVENT_SUSPEND)
@@ -1803,14 +1800,11 @@ sl811h_suspend(struct device *dev, pm_message_t state, u32 phase)
 }
 
 static int
-sl811h_resume(struct device *dev, u32 phase)
+sl811h_resume(struct device *dev)
 {
        struct usb_hcd  *hcd = dev_get_drvdata(dev);
        struct sl811    *sl811 = hcd_to_sl811(hcd);
 
-       if (phase != RESUME_POWER_ON)
-               return 0;
-
        /* with no "check to see if VBUS is still powered" board hook,
         * let's assume it'd only be powered to enable remote wakeup.
         */
index 3c72c627e65e99249ceadfbbcc5c8c4d02c8cca4..1991fdb32dfbc7b0d2592f2337c7265755d89d32 100644 (file)
@@ -73,17 +73,15 @@ static void corgibl_blank(int blank)
 }
 
 #ifdef CONFIG_PM
-static int corgibl_suspend(struct device *dev, pm_message_t state, u32 level)
+static int corgibl_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN)
-               corgibl_blank(FB_BLANK_POWERDOWN);
+       corgibl_blank(FB_BLANK_POWERDOWN);
        return 0;
 }
 
-static int corgibl_resume(struct device *dev, u32 level)
+static int corgibl_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON)
-               corgibl_blank(FB_BLANK_UNBLANK);
+       corgibl_blank(FB_BLANK_UNBLANK);
        return 0;
 }
 #else
index 1d54d3d6960b6f09be29a340794050a520d7f772..0b9301facbd356885f2ec2c8727a427358638b37 100644 (file)
@@ -424,23 +424,21 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi)
  * Power management hooks.  Note that we won't be called from IRQ context,
  * unlike the blank functions above, so we may sleep.
  */
-static int imxfb_suspend(struct device *dev, pm_message_t state, u32 level)
+static int imxfb_suspend(struct device *dev, pm_message_t state)
 {
        struct imxfb_info *fbi = dev_get_drvdata(dev);
        pr_debug("%s\n",__FUNCTION__);
 
-       if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN)
-               imxfb_disable_controller(fbi);
+       imxfb_disable_controller(fbi);
        return 0;
 }
 
-static int imxfb_resume(struct device *dev, u32 level)
+static int imxfb_resume(struct device *dev)
 {
        struct imxfb_info *fbi = dev_get_drvdata(dev);
        pr_debug("%s\n",__FUNCTION__);
 
-       if (level == RESUME_ENABLE)
-               imxfb_enable_controller(fbi);
+       imxfb_enable_controller(fbi);
        return 0;
 }
 #else
index 194eed0a238c9a355dd030d1051de9cf37d7a2bc..6206da9dd5dad23a61c8b901e4bb0e70c7c0c36a 100644 (file)
@@ -981,21 +981,19 @@ pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data)
  * Power management hooks.  Note that we won't be called from IRQ context,
  * unlike the blank functions above, so we may sleep.
  */
-static int pxafb_suspend(struct device *dev, pm_message_t state, u32 level)
+static int pxafb_suspend(struct device *dev, pm_message_t state)
 {
        struct pxafb_info *fbi = dev_get_drvdata(dev);
 
-       if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN)
-               set_ctrlr_state(fbi, C_DISABLE_PM);
+       set_ctrlr_state(fbi, C_DISABLE_PM);
        return 0;
 }
 
-static int pxafb_resume(struct device *dev, u32 level)
+static int pxafb_resume(struct device *dev)
 {
        struct pxafb_info *fbi = dev_get_drvdata(dev);
 
-       if (level == RESUME_ENABLE)
-               set_ctrlr_state(fbi, C_ENABLE_PM);
+       set_ctrlr_state(fbi, C_ENABLE_PM);
        return 0;
 }
 #else
index fa98d91c42eb2cd858b516fdcc384833094672b1..cb2f7a1de947795f3910dbac1794f65d2e496cb8 100644 (file)
@@ -655,7 +655,7 @@ bail:
 }
 
 #ifdef CONFIG_PM
-static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state, u32 level)
+static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state)
 {
        struct fb_info *info = dev_get_drvdata(dev);
        struct s1d13xxxfb_par *s1dfb = info->par;
@@ -702,15 +702,12 @@ static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state, u32 level)
                return 0;
 }
 
-static int s1d13xxxfb_resume(struct device *dev, u32 level)
+static int s1d13xxxfb_resume(struct device *dev)
 {
        struct fb_info *info = dev_get_drvdata(dev);
        struct s1d13xxxfb_par *s1dfb = info->par;
        struct s1d13xxxfb_pdata *pdata = NULL;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        /* awaken the chip */
        s1d13xxxfb_writereg(s1dfb, S1DREG_PS_CNF, 0x10);
 
index 5ab79afb53b78bdce439488c1fa53ce457290471..3862d3cb1fb2d9b1511ef94a80d2b9b72e8c08d8 100644 (file)
@@ -847,37 +847,32 @@ static int s3c2410fb_remove(struct device *dev)
 
 /* suspend and resume support for the lcd controller */
 
-static int s3c2410fb_suspend(struct device *dev, pm_message_t state, u32 level)
+static int s3c2410fb_suspend(struct device *dev, pm_message_t state)
 {
        struct fb_info     *fbinfo = dev_get_drvdata(dev);
        struct s3c2410fb_info *info = fbinfo->par;
 
-       if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN) {
-               s3c2410fb_stop_lcd();
+       s3c2410fb_stop_lcd();
 
-               /* sleep before disabling the clock, we need to ensure
-                * the LCD DMA engine is not going to get back on the bus
-                * before the clock goes off again (bjd) */
+       /* sleep before disabling the clock, we need to ensure
+        * the LCD DMA engine is not going to get back on the bus
+        * before the clock goes off again (bjd) */
 
-               msleep(1);
-               clk_disable(info->clk);
-       }
+       msleep(1);
+       clk_disable(info->clk);
 
        return 0;
 }
 
-static int s3c2410fb_resume(struct device *dev, u32 level)
+static int s3c2410fb_resume(struct device *dev)
 {
        struct fb_info     *fbinfo = dev_get_drvdata(dev);
        struct s3c2410fb_info *info = fbinfo->par;
 
-       if (level == RESUME_ENABLE) {
-               clk_enable(info->clk);
-               msleep(1);
-
-               s3c2410fb_init_registers(info);
+       clk_enable(info->clk);
+       msleep(1);
 
-       }
+       s3c2410fb_init_registers(info);
 
        return 0;
 }
index 8000890e42711fc59503488851734054251b16b0..78e5f194b0df3969daba87721acb30b2b370ec28 100644 (file)
@@ -1309,21 +1309,19 @@ sa1100fb_freq_policy(struct notifier_block *nb, unsigned long val,
  * Power management hooks.  Note that we won't be called from IRQ context,
  * unlike the blank functions above, so we may sleep.
  */
-static int sa1100fb_suspend(struct device *dev, pm_message_t state, u32 level)
+static int sa1100fb_suspend(struct device *dev, pm_message_t state)
 {
        struct sa1100fb_info *fbi = dev_get_drvdata(dev);
 
-       if (level == SUSPEND_DISABLE || level == SUSPEND_POWER_DOWN)
-               set_ctrlr_state(fbi, C_DISABLE_PM);
+       set_ctrlr_state(fbi, C_DISABLE_PM);
        return 0;
 }
 
-static int sa1100fb_resume(struct device *dev, u32 level)
+static int sa1100fb_resume(struct device *dev)
 {
        struct sa1100fb_info *fbi = dev_get_drvdata(dev);
 
-       if (level == RESUME_ENABLE)
-               set_ctrlr_state(fbi, C_ENABLE_PM);
+       set_ctrlr_state(fbi, C_ENABLE_PM);
        return 0;
 }
 #else
index 0030c071da8fd5409ebb1e3276ccb09fec4bbcd3..752bf88906a9de13b6578c8c0f2d989af87e795a 100644 (file)
@@ -438,36 +438,34 @@ static void w100fb_restore_vidmem(struct w100fb_par *par)
        }
 }
 
-static int w100fb_suspend(struct device *dev, pm_message_t state, uint32_t level)
+static int w100fb_suspend(struct device *dev, pm_message_t state)
 {
-       if (level == SUSPEND_POWER_DOWN) {
-               struct fb_info *info = dev_get_drvdata(dev);
-               struct w100fb_par *par=info->par;
-               struct w100_tg_info *tg = par->mach->tg;
-
-               w100fb_save_vidmem(par);
-               if(tg && tg->suspend)
-                       tg->suspend(par);
-               w100_suspend(W100_SUSPEND_ALL);
-               par->blanked = 1;
-       }
+       struct fb_info *info = dev_get_drvdata(dev);
+       struct w100fb_par *par=info->par;
+       struct w100_tg_info *tg = par->mach->tg;
+
+       w100fb_save_vidmem(par);
+       if(tg && tg->suspend)
+               tg->suspend(par);
+       w100_suspend(W100_SUSPEND_ALL);
+       par->blanked = 1;
+
        return 0;
 }
 
-static int w100fb_resume(struct device *dev, uint32_t level)
+static int w100fb_resume(struct device *dev)
 {
-       if (level == RESUME_POWER_ON) {
-               struct fb_info *info = dev_get_drvdata(dev);
-               struct w100fb_par *par=info->par;
-               struct w100_tg_info *tg = par->mach->tg;
+       struct fb_info *info = dev_get_drvdata(dev);
+       struct w100fb_par *par=info->par;
+       struct w100_tg_info *tg = par->mach->tg;
+
+       w100_hw_init(par);
+       w100fb_activate_var(par);
+       w100fb_restore_vidmem(par);
+       if(tg && tg->resume)
+               tg->resume(par);
+       par->blanked = 0;
 
-               w100_hw_init(par);
-               w100fb_activate_var(par);
-               w100fb_restore_vidmem(par);
-               if(tg && tg->resume)
-                       tg->resume(par);
-               par->blanked = 0;
-       }
        return 0;
 }
 #else
index 10ab7807f8ea3c202106ecb3bf8ac5da1b84b156..a9e72ac3fb9fd066ebc5607bd28cfdd4ba8f010e 100644 (file)
 #define BUS_ID_SIZE            KOBJ_NAME_LEN
 
 
-enum {
-       SUSPEND_NOTIFY,
-       SUSPEND_SAVE_STATE,
-       SUSPEND_DISABLE,
-       SUSPEND_POWER_DOWN,
-};
-
-enum {
-       RESUME_POWER_ON,
-       RESUME_RESTORE_STATE,
-       RESUME_ENABLE,
-};
-
 struct device;
 struct device_driver;
 struct class;
@@ -115,8 +102,8 @@ struct device_driver {
        int     (*probe)        (struct device * dev);
        int     (*remove)       (struct device * dev);
        void    (*shutdown)     (struct device * dev);
-       int     (*suspend)      (struct device * dev, pm_message_t state, u32 level);
-       int     (*resume)       (struct device * dev, u32 level);
+       int     (*suspend)      (struct device * dev, pm_message_t state);
+       int     (*resume)       (struct device * dev);
 };
 
 
index 38b20efc9c0b847f1a263b945e9ad31f2bddea2a..877bb00d3295d77dccc221718753532b0783ad74 100644 (file)
@@ -275,23 +275,23 @@ static int pxa2xx_ac97_do_resume(snd_card_t *card)
        return 0;
 }
 
-static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state, u32 level)
+static int pxa2xx_ac97_suspend(struct device *_dev, pm_message_t state)
 {
        snd_card_t *card = dev_get_drvdata(_dev);
        int ret = 0;
 
-       if (card && level == SUSPEND_DISABLE)
+       if (card)
                ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND);
 
        return ret;
 }
 
-static int pxa2xx_ac97_resume(struct device *_dev, u32 level)
+static int pxa2xx_ac97_resume(struct device *_dev)
 {
        snd_card_t *card = dev_get_drvdata(_dev);
        int ret = 0;
 
-       if (card && level == RESUME_ENABLE)
+       if (card)
                ret = pxa2xx_ac97_do_resume(card);
 
        return ret;
index c72a79115cca2e64ecc36fc9de1fae40bc24f2f3..59202de1d2ce3a236f47664e8d806762a2bc7eb8 100644 (file)
@@ -676,8 +676,8 @@ struct snd_generic_device {
 #define SND_GENERIC_NAME       "snd_generic"
 
 #ifdef CONFIG_PM
-static int snd_generic_suspend(struct device *dev, pm_message_t state, u32 level);
-static int snd_generic_resume(struct device *dev, u32 level);
+static int snd_generic_suspend(struct device *dev, pm_message_t state);
+static int snd_generic_resume(struct device *dev);
 #endif
 
 /* initialized in sound.c */
@@ -818,13 +818,10 @@ int snd_card_set_pm_callback(snd_card_t *card,
 
 #ifdef CONFIG_SND_GENERIC_DRIVER
 /* suspend/resume callbacks for snd_generic platform device */
-static int snd_generic_suspend(struct device *dev, pm_message_t state, u32 level)
+static int snd_generic_suspend(struct device *dev, pm_message_t state)
 {
        snd_card_t *card;
 
-       if (level != SUSPEND_DISABLE)
-               return 0;
-
        card = get_snd_generic_card(dev);
        if (card->power_state == SNDRV_CTL_POWER_D3hot)
                return 0;
@@ -834,13 +831,10 @@ static int snd_generic_suspend(struct device *dev, pm_message_t state, u32 level
        return 0;
 }
 
-static int snd_generic_resume(struct device *dev, u32 level)
+static int snd_generic_resume(struct device *dev)
 {
        snd_card_t *card;
 
-       if (level != RESUME_ENABLE)
-               return 0;
-
        card = get_snd_generic_card(dev);
        if (card->power_state == SNDRV_CTL_POWER_D0)
                return 0;
index becbc420ba41a073ba1fb9c7a5dbc0330b8541f7..ec70fadde7d9e39bd9e19036456ded73df0cef84 100644 (file)
@@ -31,7 +31,8 @@ static int ac97_bus_suspend(struct device *dev, pm_message_t state)
        int ret = 0;
 
        if (dev->driver && dev->driver->suspend)
-               ret = dev->driver->suspend(dev, state, SUSPEND_POWER_DOWN);
+               ret = dev->driver->suspend(dev, state);
+
        return ret;
 }
 
@@ -40,7 +41,8 @@ static int ac97_bus_resume(struct device *dev)
        int ret = 0;
 
        if (dev->driver && dev->driver->resume)
-               ret = dev->driver->resume(dev, RESUME_POWER_ON);
+               ret = dev->driver->resume(dev);
+
        return ret;
 }