char/agp: replace numeric with standard PM state macros
authorYijing Wang <wangyijing@huawei.com>
Thu, 27 Jun 2013 12:52:36 +0000 (20:52 +0800)
committerDave Airlie <airlied@redhat.com>
Thu, 27 Jun 2013 22:15:33 +0000 (08:15 +1000)
Use standard PM state macros PCI_Dx instead of numeric 0/1/2..

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/char/agp/ati-agp.c
drivers/char/agp/nvidia-agp.c

index 0628d7b65c71c4073d2ff1428a2e7dfad4b5d720..03c1dc1ab5528d2475f2f2285fecc16b301de102 100644 (file)
@@ -236,14 +236,14 @@ static int ati_configure(void)
 static int agp_ati_suspend(struct pci_dev *dev, pm_message_t state)
 {
        pci_save_state(dev);
-       pci_set_power_state(dev, 3);
+       pci_set_power_state(dev, PCI_D3hot);
 
        return 0;
 }
 
 static int agp_ati_resume(struct pci_dev *dev)
 {
-       pci_set_power_state(dev, 0);
+       pci_set_power_state(dev, PCI_D0);
        pci_restore_state(dev);
 
        return ati_configure();
index 62be3ec0da4b1ae6f8f9cb9f05f6b0fb1eed2740..be42a2312dc9718f269cfcf5d77372a11d59e790 100644 (file)
@@ -399,8 +399,8 @@ static void agp_nvidia_remove(struct pci_dev *pdev)
 #ifdef CONFIG_PM
 static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state)
 {
-       pci_save_state (pdev);
-       pci_set_power_state (pdev, 3);
+       pci_save_state(pdev);
+       pci_set_power_state(pdev, PCI_D3hot);
 
        return 0;
 }
@@ -408,7 +408,7 @@ static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state)
 static int agp_nvidia_resume(struct pci_dev *pdev)
 {
        /* set power state 0 and restore PCI space */
-       pci_set_power_state (pdev, 0);
+       pci_set_power_state(pdev, PCI_D0);
        pci_restore_state(pdev);
 
        /* reconfigure AGP hardware again */