]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/cpqphp_core.c
Get rid of unused variable warning in drivers/pci/hotplug/pci_hotplug_core.c
[linux-2.6] / drivers / pci / hotplug / cpqphp_core.c
index 1fc259913b68448b5a0b7e798d0b68ca08ae57e8..a96b739b2d35e2ccf1453ffeb92550850fbe3b89 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/pci.h>
+#include <linux/pci_hotplug.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 
@@ -44,7 +45,7 @@
 
 #include "cpqphp.h"
 #include "cpqphp_nvram.h"
-#include "../../../arch/i386/pci/pci.h"        /* horrible hack showing how processor dependent we are... */
+#include "../../../arch/x86/pci/pci.h" /* horrible hack showing how processor dependent we are... */
 
 
 /* Global variables */
@@ -548,7 +549,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
                         * slot. */
                        bus->number = tbus;
                        pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0),
-                                               PCI_REVISION_ID, &work);
+                                               PCI_CLASS_REVISION, &work);
 
                        if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) {
                                pci_bus_read_config_dword(bus,
@@ -795,7 +796,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        u8 num_of_slots = 0;
        u8 hp_slot = 0;
        u8 device;
-       u8 rev;
        u8 bus_cap;
        u16 temp_word;
        u16 vendor_id;
@@ -822,9 +822,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
        dbg("Vendor ID: %x\n", vendor_id);
 
-       rc = pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
-       dbg("revision: %d\n", rev);
-       if (rc || ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!rev))) {
+       dbg("revision: %d\n", pdev->revision);
+       if ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!pdev->revision)) {
                err(msg_HPC_rev_error);
                rc = -ENODEV;
                goto err_disable_device;
@@ -835,7 +834,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
         * For Intel, each SSID bit identifies a PHP capability.
         * Also Intel HPC's may have RID=0.
         */
-       if ((rev > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) {
+       if ((pdev->revision > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) {
                // TODO: This code can be made to support non-Compaq or Intel subsystem IDs
                rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid);
                if (rc) {
@@ -869,7 +868,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
                switch (subsystem_vid) {
                        case PCI_VENDOR_ID_COMPAQ:
-                               if (rev >= 0x13) { /* CIOBX */
+                               if (pdev->revision >= 0x13) { /* CIOBX */
                                        ctrl->push_flag = 1;
                                        ctrl->slot_switch_type = 1;
                                        ctrl->push_button = 1;
@@ -1074,7 +1073,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus));
 
        ctrl->bus = pdev->bus->number;
-       ctrl->rev = rev;
+       ctrl->rev = pdev->revision;
        dbg("bus device function rev: %d %d %d %d\n", ctrl->bus,
                PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev);