diff mbox series

[net-next,v2] PCI: add USR vendor id and use it in r8169 and w6692 driver

Message ID f35fbe1d-b1f3-c0f8-82d6-18b0c7cda0b4@gmail.com
State Not Applicable
Delegated to: Bjorn Helgaas
Headers show
Series [net-next,v2] PCI: add USR vendor id and use it in r8169 and w6692 driver | expand

Commit Message

Heiner Kallweit Nov. 11, 2018, 10:50 a.m. UTC
The PCI vendor id of U.S. Robotics isn't defined in pci_ids.h so far,
only ISDN driver w6692 has a private definition. Move the definition
to pci_ids.h and use it also in the r8169 driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- The original patch caused a build failure in w6692 driver because
  it broke the private PCI device id definition.

I hope it's ok to submit this through the netdev tree.
---
 drivers/isdn/hardware/mISDN/w6692.c  | 5 -----
 drivers/net/ethernet/realtek/r8169.c | 2 +-
 include/linux/pci_ids.h              | 4 ++++
 3 files changed, 5 insertions(+), 6 deletions(-)

Comments

David Miller Nov. 11, 2018, 6:23 p.m. UTC | #1
From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Sun, 11 Nov 2018 11:50:08 +0100

> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index 69f0abe1b..1fac231fe 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2359,6 +2359,10 @@
>  
>  #define PCI_VENDOR_ID_SYNOPSYS		0x16c3
>  
> +#define PCI_VENDOR_ID_USR		0x16ec
> +#define PCI_DEVICE_ID_USR_997902	0x0116
> +#define PCI_DEVICE_ID_USR_6692		0x3409
> +
>  #define PCI_VENDOR_ID_VITESSE		0x1725
>  #define PCI_DEVICE_ID_VITESSE_VSC7174	0x7174

Generally, as I understand the policy for linux/pci_ids.h, we only add
things used in multiple locations.

So PCI_VENDOR_ID_USR is OK, since it is used in both r8169 and w6692.

But the device IDs are not, since only w6692 uses them.
diff mbox series

Patch

diff --git a/drivers/isdn/hardware/mISDN/w6692.c b/drivers/isdn/hardware/mISDN/w6692.c
index 5acf6ab67..f6b4f4f11 100644
--- a/drivers/isdn/hardware/mISDN/w6692.c
+++ b/drivers/isdn/hardware/mISDN/w6692.c
@@ -52,11 +52,6 @@  static const struct w6692map  w6692_map[] =
 	{W6692_USR, "USR W6692"}
 };
 
-#ifndef PCI_VENDOR_ID_USR
-#define PCI_VENDOR_ID_USR	0x16ec
-#define PCI_DEVICE_ID_USR_6692	0x3409
-#endif
-
 struct w6692_ch {
 	struct bchannel		bch;
 	u32			addr;
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 1fd01688d..366a690eb 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -224,7 +224,7 @@  static const struct pci_device_id rtl8169_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4300), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_DLINK,	0x4302), 0, 0, RTL_CFG_0 },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AT,		0xc107), 0, 0, RTL_CFG_0 },
-	{ PCI_DEVICE(0x16ec,			0x0116), 0, 0, RTL_CFG_0 },
+	{ PCI_DEVICE(PCI_VENDOR_ID_USR,		0x0116), 0, 0, RTL_CFG_0 },
 	{ PCI_VENDOR_ID_LINKSYS,		0x1032,
 		PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 },
 	{ 0x0001,				0x8168,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 69f0abe1b..1fac231fe 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2359,6 +2359,10 @@ 
 
 #define PCI_VENDOR_ID_SYNOPSYS		0x16c3
 
+#define PCI_VENDOR_ID_USR		0x16ec
+#define PCI_DEVICE_ID_USR_997902	0x0116
+#define PCI_DEVICE_ID_USR_6692		0x3409
+
 #define PCI_VENDOR_ID_VITESSE		0x1725
 #define PCI_DEVICE_ID_VITESSE_VSC7174	0x7174