netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lanai: use pci_dev->subsystem_device
@ 2011-07-12 14:47 Sergei Shtylyov
  2011-07-12 14:59 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2011-07-12 14:47 UTC (permalink / raw)
  To: chas, linux-atm-general; +Cc: netdev

The driver reads PCI subsystem IDs from the PCI configuration registers while
it is already stored by the PCI subsystem in the 'subsystem_device' field of
'struct pci_dev'...

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

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

 drivers/atm/lanai.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Index: linux-2.6/drivers/atm/lanai.c
===================================================================
--- linux-2.6.orig/drivers/atm/lanai.c
+++ linux-2.6/drivers/atm/lanai.c
@@ -1947,7 +1947,6 @@ static int __devinit lanai_pci_start(str
 {
 	struct pci_dev *pci = lanai->pci;
 	int result;
-	u16 w;
 
 	if (pci_enable_device(pci) != 0) {
 		printk(KERN_ERR DEV_LABEL "(itf %d): can't enable "
@@ -1965,13 +1964,7 @@ static int __devinit lanai_pci_start(str
 		    "(itf %d): No suitable DMA available.\n", lanai->number);
 		return -EBUSY;
 	}
-	result = pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &w);
-	if (result != PCIBIOS_SUCCESSFUL) {
-		printk(KERN_ERR DEV_LABEL "(itf %d): can't read "
-		    "PCI_SUBSYSTEM_ID: %d\n", lanai->number, result);
-		return -EINVAL;
-	}
-	result = check_board_id_and_rev("PCI", w, NULL);
+	result = check_board_id_and_rev("PCI", pci->subsystem_device, NULL);
 	if (result != 0)
 		return result;
 	/* Set latency timer to zero as per lanai docs */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] lanai: use pci_dev->subsystem_device
  2011-07-12 14:47 [PATCH] lanai: use pci_dev->subsystem_device Sergei Shtylyov
@ 2011-07-12 14:59 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-07-12 14:59 UTC (permalink / raw)
  To: sshtylyov; +Cc: chas, linux-atm-general, netdev

From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Date: Tue, 12 Jul 2011 18:47:57 +0400

> The driver reads PCI subsystem IDs from the PCI configuration registers while
> it is already stored by the PCI subsystem in the 'subsystem_device' field of
> 'struct pci_dev'...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Applied to net-next-2.6, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-12 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-12 14:47 [PATCH] lanai: use pci_dev->subsystem_device Sergei Shtylyov
2011-07-12 14:59 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).