Skip to contentSkip to conversation

ssb: use pci_dev->revision

PATCH Applied Sergei Shtylyov 2 participants 2 messages Jul 1, 2011 – Jul 5, 2011

Subsystems (3)

v2 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/3 ssb: use pci_dev->revision

The SSB code reads PCI revision ID from the PCI configuration register while it's already stored by the PCI subsystem in the 'revision' field of 'struct pci_dev'...

---
The patch is against the recent Linus' tree.

 drivers/ssb/pci.c  |    3 +--
 drivers/ssb/scan.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/ssb/pci.c +1 -2
Index: linux-2.6/drivers/ssb/pci.c
===================================================================
@@ -738,8 +738,7 @@ static void ssb_pci_get_boardinfo(struct
 			     &bi->vendor);
 	pci_read_config_word(bus->host_pci, PCI_SUBSYSTEM_ID,
 			     &bi->type);
-	pci_read_config_byte(bus->host_pci, PCI_REVISION_ID,
-			     &bi->rev);
+	bi->rev = bus->host_pci->revision;
 }
 
 int ssb_pci_get_invariants(struct ssb_bus *bus,
drivers/ssb/scan.c +1 -2
Index: linux-2.6/drivers/ssb/scan.c
===================================================================
@@ -310,8 +310,7 @@ int ssb_bus_scan(struct ssb_bus *bus,
 	} else {
 		if (bus->bustype == SSB_BUSTYPE_PCI) {
 			bus->chip_id = pcidev_to_chipid(bus->host_pci);
-			pci_read_config_byte(bus->host_pci, PCI_REVISION_ID,
-					     &bus->chip_rev);
+			bus->chip_rev = bus->host_pci->revision;
 			bus->chip_package = 0;
 		} else {
 			bus->chip_id = 0x4710;
#1 lore raw
Quoted 5 lines · Sergei Shtylyov

The SSB code reads PCI revision ID from the PCI configuration register while it's already stored by the PCI subsystem in the 'revision' field of 'struct pci_dev'...

Applied.

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.