[PATCH 2/3] tty: rocket: Explicitly list supported PCI IDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matching PCI_ANY_ID causes conflicts with RocketPort 2 adapters, which
are supported by a different driver.

Signed-off-by: Kevin Cernekee <cernekee@xxxxxxxxx>
---
 drivers/tty/rocket.c |   31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c
index e42009a..c73ca4e 100644
--- a/drivers/tty/rocket.c
+++ b/drivers/tty/rocket.c
@@ -1758,8 +1758,32 @@ static void rp_flush_buffer(struct tty_struct *tty)
 
 #ifdef CONFIG_PCI
 
-static struct pci_device_id __used rocket_pci_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) },
+#define RP_PCI_DEVICE(id) \
+	{ PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_DEVICE_ID_##id) }
+
+static DEFINE_PCI_DEVICE_TABLE(rocket_pci_ids) = {
+	RP_PCI_DEVICE(RP4QUAD),
+	RP_PCI_DEVICE(RP8OCTA),
+	RP_PCI_DEVICE(URP8OCTA),
+	RP_PCI_DEVICE(RP8INTF),
+	RP_PCI_DEVICE(URP8INTF),
+	RP_PCI_DEVICE(RP8J),
+	RP_PCI_DEVICE(RP4J),
+	RP_PCI_DEVICE(RP8SNI),
+	RP_PCI_DEVICE(RP16SNI),
+	RP_PCI_DEVICE(RP16INTF),
+	RP_PCI_DEVICE(URP16INTF),
+	RP_PCI_DEVICE(CRP16INTF),
+	RP_PCI_DEVICE(RP32INTF),
+	RP_PCI_DEVICE(URP32INTF),
+	RP_PCI_DEVICE(RPP4),
+	RP_PCI_DEVICE(RPP8),
+	RP_PCI_DEVICE(RP2_232),
+	RP_PCI_DEVICE(RP2_422),
+	RP_PCI_DEVICE(RP6M),
+	RP_PCI_DEVICE(RP4M),
+	RP_PCI_DEVICE(UPCI_RM3_8PORT),
+	RP_PCI_DEVICE(UPCI_RM3_4PORT),
 	{ }
 };
 MODULE_DEVICE_TABLE(pci, rocket_pci_ids);
@@ -1781,7 +1805,8 @@ static __init int register_PCI(int i, struct pci_dev *dev)
 	WordIO_t ConfigIO = 0;
 	ByteIO_t UPCIRingInd = 0;
 
-	if (!dev || pci_enable_device(dev))
+	if (!dev || !pci_match_id(rocket_pci_ids, dev) ||
+	    pci_enable_device(dev))
 		return 0;
 
 	rcktpt_io_addr[i] = pci_resource_start(dev, 0);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux