]> err.no Git - linux-2.6/commitdiff
[PATCH] swsusp: fix remaining u32 vs. pm_message_t confusion
authorPavel Machek <pavel@ucw.cz>
Sat, 3 Sep 2005 22:56:56 +0000 (15:56 -0700)
committerLinus Torvalds <torvalds@evo.osdl.org>
Mon, 5 Sep 2005 07:06:15 +0000 (00:06 -0700)
Fix remaining bits of u32 vs.  pm_message confusion.  Should not break
anything.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 files changed:
arch/i386/kernel/cpu/mtrr/main.c
arch/ppc/platforms/pmac_pic.c
arch/ppc/syslib/open_pic.c
arch/x86_64/kernel/nmi.c
drivers/ide/ppc/pmac.c
drivers/macintosh/mediabay.c
drivers/media/video/bttv-driver.c
drivers/media/video/msp3400.c
drivers/media/video/tda9887.c
drivers/media/video/tuner-core.c
drivers/net/bnx2.c
drivers/net/e1000/e1000_main.c
drivers/net/irda/vlsi_ir.c
drivers/net/phy/mdio_bus.c
drivers/net/wireless/orinoco_pci.c
drivers/net/wireless/prism54/islpci_hotplug.c
drivers/video/s1d13xxxfb.c
drivers/video/savage/savagefb_driver.c
sound/pci/atiixp.c

index 764cac64e21191310d198e3bd590564e6939d76f..dd4ebd6af7e4cc5e014dff4ab72a3a1ac2650619 100644 (file)
@@ -561,7 +561,7 @@ struct mtrr_value {
 
 static struct mtrr_value * mtrr_state;
 
-static int mtrr_save(struct sys_device * sysdev, u32 state)
+static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
 {
        int i;
        int size = num_var_ranges * sizeof(struct mtrr_value);
index 9f92e1bb7f346b00ea715354da8fbd87081a22fe..2ce058895e039438d70d5a0964bd111356c243e5 100644 (file)
@@ -619,7 +619,7 @@ not_found:
        return viaint;
 }
 
-static int pmacpic_suspend(struct sys_device *sysdev, u32 state)
+static int pmacpic_suspend(struct sys_device *sysdev, pm_message_t state)
 {
        int viaint = pmacpic_find_viaint();
 
index ad39b86ca92ca545c879c951307a05c3f0404208..53da58523e39f3380e303f4f33e0ca20c32db81d 100644 (file)
@@ -948,7 +948,7 @@ static void openpic_cached_disable_irq(u_int irq)
  * we need something better to deal with that... Maybe switch to S1 for
  * cpufreq changes
  */
-int openpic_suspend(struct sys_device *sysdev, u32 state)
+int openpic_suspend(struct sys_device *sysdev, pm_message_t state)
 {
        int     i;
        unsigned long flags;
index 4e44d6e6b7e52f35d55993ea9616d4ef39a165fa..64a8e05d5811b82fd258365d539ea37c72ed0b2c 100644 (file)
@@ -290,7 +290,7 @@ void enable_timer_nmi_watchdog(void)
 
 static int nmi_pm_active; /* nmi_active before suspend */
 
-static int lapic_nmi_suspend(struct sys_device *dev, u32 state)
+static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state)
 {
        nmi_pm_active = nmi_active;
        disable_lapic_nmi_watchdog();
index ea65b070a3675b2e3c3f2b6e1e1840f93adb6cb8..d2760b8ca1590c3e0294ac2a274fa88c41545d3c 100644 (file)
@@ -1504,7 +1504,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
 }
 
 static int
-pmac_ide_macio_suspend(struct macio_dev *mdev, u32 state)
+pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t state)
 {
        ide_hwif_t      *hwif = (ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev);
        int             rc = 0;
@@ -1527,7 +1527,7 @@ pmac_ide_macio_resume(struct macio_dev *mdev)
        if (mdev->ofdev.dev.power.power_state != 0) {
                rc = pmac_ide_do_resume(hwif);
                if (rc == 0)
-                       mdev->ofdev.dev.power.power_state = 0;
+                       mdev->ofdev.dev.power.power_state = PMSG_ON;
        }
 
        return rc;
@@ -1608,7 +1608,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
 }
 
 static int
-pmac_ide_pci_suspend(struct pci_dev *pdev, u32 state)
+pmac_ide_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        ide_hwif_t      *hwif = (ide_hwif_t *)pci_get_drvdata(pdev);
        int             rc = 0;
@@ -1631,7 +1631,7 @@ pmac_ide_pci_resume(struct pci_dev *pdev)
        if (pdev->dev.power.power_state != 0) {
                rc = pmac_ide_do_resume(hwif);
                if (rc == 0)
-                       pdev->dev.power.power_state = 0;
+                       pdev->dev.power.power_state = PMSG_ON;
        }
 
        return rc;
index 7c16c25fc5d471068945bf04d9bc00c63b4e037f..7e1afca75e4119b758bd87932ee01752cc723754 100644 (file)
@@ -724,7 +724,7 @@ static int __pmac media_bay_resume(struct macio_dev *mdev)
        struct media_bay_info   *bay = macio_get_drvdata(mdev);
 
        if (mdev->ofdev.dev.power.power_state != 0) {
-               mdev->ofdev.dev.power.power_state = 0;
+               mdev->ofdev.dev.power.power_state = PMSG_ON;
 
                /* We re-enable the bay using it's previous content
                   only if it did not change. Note those bozo timings,
index eee9322ce21b06efb02a6bf51e2b662231983189..087efb4dea09a4b67a36e21a7a46c28f76c8831a 100644 (file)
@@ -4047,7 +4047,6 @@ static int bttv_suspend(struct pci_dev *pci_dev, pm_message_t state)
        struct bttv_buffer_set idle;
        unsigned long flags;
 
-       dprintk("bttv%d: suspend %d\n", btv->c.nr, state);
 
        /* stop dma + irqs */
        spin_lock_irqsave(&btv->s_lock,flags);
index 62f1b8ddb98b8bc153602271c7d84337c6e67efe..e956234abf24973be0134594c7be1a5368813fea 100644 (file)
@@ -1416,7 +1416,7 @@ 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, u32 state, u32 level);
+static int msp_suspend(struct device * dev, pm_message_t state, u32 level);
 static int msp_resume(struct device * dev, u32 level);
 
 static void msp_wake_thread(struct i2c_client *client);
@@ -1817,7 +1817,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int msp_suspend(struct device * dev, u32 state, u32 level)
+static int msp_suspend(struct device * dev, pm_message_t state, u32 level)
 {
        struct i2c_client *c = container_of(dev, struct i2c_client, dev);
 
index 108c3ad7d62229f73d29e0c75459311da8d8e359..a28a395d6dfe579ad06f128a19f61bed031471a6 100644 (file)
@@ -760,7 +760,7 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int tda9887_suspend(struct device * dev, u32 state, u32 level)
+static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level)
 {
        dprintk("tda9887: suspend\n");
        return 0;
index f0a579827a2416d0c132320ac8842118a220ae45..a155e99a263b5bfb26a006c42065da2017fda76c 100644 (file)
@@ -672,7 +672,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
        return 0;
 }
 
-static int tuner_suspend(struct device *dev, u32 state, u32 level)
+static int tuner_suspend(struct device *dev, pm_message_t state, u32 level)
 {
        struct i2c_client *c = container_of (dev, struct i2c_client, dev);
        struct tuner *t = i2c_get_clientdata (c);
index 7babf6af4e28dd1113b467dd47907e191aad9b02..55a72c7ad001a20ae03b4c3ebf3fe61281688884 100644 (file)
@@ -2004,14 +2004,14 @@ bnx2_init_cpus(struct bnx2 *bp)
 }
 
 static int
-bnx2_set_power_state(struct bnx2 *bp, int state)
+bnx2_set_power_state(struct bnx2 *bp, pci_power_t state)
 {
        u16 pmcsr;
 
        pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
 
        switch (state) {
-       case 0: {
+       case PCI_D0: {
                u32 val;
 
                pci_write_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL,
@@ -2032,7 +2032,7 @@ bnx2_set_power_state(struct bnx2 *bp, int state)
                REG_WR(bp, BNX2_RPM_CONFIG, val);
                break;
        }
-       case 3: {
+       case PCI_D3hot: {
                int i;
                u32 val, wol_msg;
 
@@ -3886,7 +3886,7 @@ bnx2_open(struct net_device *dev)
        struct bnx2 *bp = dev->priv;
        int rc;
 
-       bnx2_set_power_state(bp, 0);
+       bnx2_set_power_state(bp, PCI_D0);
        bnx2_disable_int(bp);
 
        rc = bnx2_alloc_mem(bp);
@@ -4197,7 +4197,7 @@ bnx2_close(struct net_device *dev)
        bnx2_free_mem(bp);
        bp->link_up = 0;
        netif_carrier_off(bp->dev);
-       bnx2_set_power_state(bp, 3);
+       bnx2_set_power_state(bp, PCI_D3hot);
        return 0;
 }
 
@@ -5203,7 +5203,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
                               BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
                               BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
 
-       bnx2_set_power_state(bp, 0);
+       bnx2_set_power_state(bp, PCI_D0);
 
        bp->chip_id = REG_RD(bp, BNX2_MISC_ID);
 
@@ -5495,7 +5495,7 @@ bnx2_remove_one(struct pci_dev *pdev)
 }
 
 static int
-bnx2_suspend(struct pci_dev *pdev, u32 state)
+bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata(pdev);
        struct bnx2 *bp = dev->priv;
@@ -5513,7 +5513,7 @@ bnx2_suspend(struct pci_dev *pdev, u32 state)
                reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
        bnx2_reset_chip(bp, reset_code);
        bnx2_free_skbs(bp);
-       bnx2_set_power_state(bp, state);
+       bnx2_set_power_state(bp, pci_choose_state(pdev, state));
        return 0;
 }
 
@@ -5526,7 +5526,7 @@ bnx2_resume(struct pci_dev *pdev)
        if (!netif_running(dev))
                return 0;
 
-       bnx2_set_power_state(bp, 0);
+       bnx2_set_power_state(bp, PCI_D0);
        netif_device_attach(dev);
        bnx2_init_nic(bp);
        bnx2_netif_start(bp);
index 9b596e0bbf95cc04d73448a38098e9dc3f003bae..7c8a0a22dcd5425545389fb056f9e9a1f4ee8f90 100644 (file)
@@ -162,7 +162,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
 static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
 static void e1000_restore_vlan(struct e1000_adapter *adapter);
 
-static int e1000_suspend(struct pci_dev *pdev, uint32_t state);
+static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
 #ifdef CONFIG_PM
 static int e1000_resume(struct pci_dev *pdev);
 #endif
@@ -3642,7 +3642,7 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, uint16_t spddplx)
 }
 
 static int
-e1000_suspend(struct pci_dev *pdev, uint32_t state)
+e1000_suspend(struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct e1000_adapter *adapter = netdev_priv(netdev);
@@ -3726,9 +3726,7 @@ e1000_suspend(struct pci_dev *pdev, uint32_t state)
        }
 
        pci_disable_device(pdev);
-
-       state = (state > 0) ? 3 : 0;
-       pci_set_power_state(pdev, state);
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
 
        return 0;
 }
@@ -3741,13 +3739,13 @@ e1000_resume(struct pci_dev *pdev)
        struct e1000_adapter *adapter = netdev_priv(netdev);
        uint32_t manc, ret_val, swsm;
 
-       pci_set_power_state(pdev, 0);
+       pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
        ret_val = pci_enable_device(pdev);
        pci_set_master(pdev);
 
-       pci_enable_wake(pdev, 3, 0);
-       pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */
+       pci_enable_wake(pdev, PCI_D3hot, 0);
+       pci_enable_wake(pdev, PCI_D3cold, 0);
 
        e1000_reset(adapter);
        E1000_WRITE_REG(&adapter->hw, WUS, ~0);
index 006e4f57560675bb48a19b62fa6ec54fd0158337..4be95398bac47e2624846553afdd4862f2db31a5 100644 (file)
@@ -1749,11 +1749,6 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
        struct net_device *ndev = pci_get_drvdata(pdev);
        vlsi_irda_dev_t *idev;
 
-       if (state < 1 || state > 3 ) {
-               IRDA_ERROR("%s - %s: invalid pm state request: %u\n",
-                          __FUNCTION__, PCIDEV_NAME(pdev), state);
-               return 0;
-       }
        if (!ndev) {
                IRDA_ERROR("%s - %s: no netdevice \n",
                           __FUNCTION__, PCIDEV_NAME(pdev));
@@ -1781,7 +1776,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
                        idev->new_baud = idev->baud;
        }
 
-       pci_set_power_state(pdev,state);
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
        pdev->current_state = state;
        idev->resume_ok = 1;
        up(&idev->sem);
@@ -1807,8 +1802,8 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
                return 0;
        }
        
-       pci_set_power_state(pdev, 0);
-       pdev->current_state = 0;
+       pci_set_power_state(pdev, PCI_D0);
+       pdev->current_state = PM_EVENT_ON;
 
        if (!idev->resume_ok) {
                /* should be obsolete now - but used to happen due to:
index 41f62c0c5fcb54c733243fe3799c81373316ae90..5e81494e9a9ad9d35e368e941d5a40cac3be8462 100644 (file)
@@ -128,7 +128,7 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
 /* Suspend and resume.  Copied from platform_suspend and
  * platform_resume
  */
-static int mdio_bus_suspend(struct device * dev, u32 state)
+static int mdio_bus_suspend(struct device * dev, pm_message_t state)
 {
        int ret = 0;
        struct device_driver *drv = dev->driver;
index 7a6f52ea7faa306ac5f4af3525528d5754a5fe4e..42e03438291b8e3ad7967ea93198c996211434ed 100644 (file)
@@ -301,8 +301,6 @@ static int orinoco_pci_suspend(struct pci_dev *pdev, pm_message_t state)
        unsigned long flags;
        int err;
        
-       printk(KERN_DEBUG "%s: Orinoco-PCI entering sleep mode (state=%d)\n",
-              dev->name, state);
 
        err = orinoco_lock(priv, &flags);
        if (err) {
index c17391d947f31a30460d50b6ae56a072dd24b5aa..dc040caab7d746e61a8c4c87c6149f33924e07cc 100644 (file)
@@ -267,8 +267,6 @@ prism54_suspend(struct pci_dev *pdev, pm_message_t state)
        islpci_private *priv = ndev ? netdev_priv(ndev) : NULL;
        BUG_ON(!priv);
 
-       printk(KERN_NOTICE "%s: got suspend request (state %d)\n",
-              ndev->name, state);
 
        pci_save_state(pdev);
 
index 3848be2b9d2d6e9a30194dd693f368c70d1d1dfa..fa98d91c42eb2cd858b516fdcc384833094672b1 100644 (file)
@@ -655,7 +655,7 @@ bail:
 }
 
 #ifdef CONFIG_PM
-static int s1d13xxxfb_suspend(struct device *dev, u32 state, u32 level)
+static int s1d13xxxfb_suspend(struct device *dev, pm_message_t state, u32 level)
 {
        struct fb_info *info = dev_get_drvdata(dev);
        struct s1d13xxxfb_par *s1dfb = info->par;
index f4633d1891f121070b68ae5c4cb4f53cf0d76ddc..117ad42f120d9c867599a36bcd0a804045732246 100644 (file)
@@ -2110,7 +2110,6 @@ static int savagefb_suspend (struct pci_dev* dev, pm_message_t state)
        struct savagefb_par *par = (struct savagefb_par *)info->par;
 
        DBG("savagefb_suspend");
-       printk(KERN_DEBUG "state: %u\n", state);
 
        acquire_console_sem();
        fb_set_suspend(info, pci_choose_state(dev, state));
index 904d17394e1c595593f0a60beec7a4f41c493e31..188df085b7ee5d4ae21903bebd1b6381b48cdc6a 100644 (file)
@@ -1427,7 +1427,7 @@ static int snd_atiixp_suspend(snd_card_t *card, pm_message_t state)
        snd_atiixp_aclink_down(chip);
        snd_atiixp_chip_stop(chip);
 
-       pci_set_power_state(chip->pci, 3);
+       pci_set_power_state(chip->pci, PCI_D3hot);
        pci_disable_device(chip->pci);
        return 0;
 }
@@ -1438,7 +1438,7 @@ static int snd_atiixp_resume(snd_card_t *card)
        int i;
 
        pci_enable_device(chip->pci);
-       pci_set_power_state(chip->pci, 0);
+       pci_set_power_state(chip->pci, PCI_D0);
        pci_set_master(chip->pci);
 
        snd_atiixp_aclink_reset(chip);