public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru•mvista.com>
To: mb@bu3sch•de, netdev@vger•kernel.org
Subject: [PATCH 2/3 v2] ssb: use pci_dev->revision
Date: Fri, 1 Jul 2011 22:33:08 +0400	[thread overview]
Message-ID: <201107012233.08489.sshtylyov@ru.mvista.com> (raw)

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'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru•mvista.com>

---
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(-)

Index: linux-2.6/drivers/ssb/pci.c
===================================================================
--- linux-2.6.orig/drivers/ssb/pci.c
+++ 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,
Index: linux-2.6/drivers/ssb/scan.c
===================================================================
--- linux-2.6.orig/drivers/ssb/scan.c
+++ 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;

             reply	other threads:[~2011-07-01 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 18:33 Sergei Shtylyov [this message]
2011-07-05 19:34 ` [PATCH 2/3 v2] ssb: use pci_dev->revision John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107012233.08489.sshtylyov@ru.mvista.com \
    --to=sshtylyov@ru$(echo .)mvista.com \
    --cc=mb@bu3sch$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox