[CPUFREQ] Longhaul - Correct PCI code
authorRafał Bilski <rafalbilski@interia.pl>
Fri, 2 Mar 2007 19:12:27 +0000 (20:12 +0100)
committerDave Jones <davej@redhat.com>
Thu, 26 Apr 2007 18:32:02 +0000 (14:32 -0400)
Replace obsolete pci_find_device with pci_get_device.

Signed-off-by: Rafal Bilski <rafalbilski@interia.pl>
Signed-off-by: Dave Jones <davej@redhat.com>
arch/i386/kernel/cpu/cpufreq/longhaul.c

index 2b030d6ccbf7336d6cb6f14c813ea049d3d60184..e5fee7266348a75961b55e9ae4bd3809ab416bff 100644 (file)
@@ -590,20 +590,23 @@ static acpi_status longhaul_walk_callback(acpi_handle obj_handle,
 static int enable_arbiter_disable(void)
 {
        struct pci_dev *dev;
+       int status;
        int reg;
        u8 pci_cmd;
 
+       status = 1;
        /* Find PLE133 host bridge */
        reg = 0x78;
-       dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, NULL);
+       dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0,
+                            NULL);
        /* Find CLE266 host bridge */
        if (dev == NULL) {
                reg = 0x76;
-               dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_862X_0, NULL);
+               dev = pci_get_device(PCI_VENDOR_ID_VIA,
+                                    PCI_DEVICE_ID_VIA_862X_0, NULL);
                /* Find CN400 V-Link host bridge */
                if (dev == NULL)
-                       dev = pci_find_device(PCI_VENDOR_ID_VIA, 0x7259, NULL);
-
+                       dev = pci_get_device(PCI_VENDOR_ID_VIA, 0x7259, NULL);
        }
        if (dev != NULL) {
                /* Enable access to port 0x22 */
@@ -615,10 +618,11 @@ static int enable_arbiter_disable(void)
                        if (!(pci_cmd & 1<<7)) {
                                printk(KERN_ERR PFX
                                        "Can't enable access to port 0x22.\n");
-                               return 0;
+                               status = 0;
                        }
                }
-               return 1;
+               pci_dev_put(dev);
+               return status;
        }
        return 0;
 }
@@ -629,7 +633,7 @@ static int longhaul_setup_vt8235(void)
        u8 pci_cmd;
 
        /* Find VT8235 southbridge */
-       dev = pci_find_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL);
+       dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL);
        if (dev != NULL) {
                /* Set transition time to max */
                pci_read_config_byte(dev, 0xec, &pci_cmd);
@@ -641,6 +645,7 @@ static int longhaul_setup_vt8235(void)
                pci_read_config_byte(dev, 0xe5, &pci_cmd);
                pci_cmd |= 1 << 7;
                pci_write_config_byte(dev, 0xe5, pci_cmd);
+               pci_dev_put(dev);
                return 1;
        }
        return 0;