netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S
@ 2019-03-18 13:51 helgaas
  2019-03-19  1:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: helgaas @ 2019-03-18 13:51 UTC (permalink / raw)
  To: Karsten Keil; +Cc: netdev, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

The device ID alone does not uniquely identify a device.  Test both the
vendor and device ID to make sure we don't mistakenly think some other
vendor's 0xB410 device is a Digium HFC4S.  Also, instead of the bare hex
ID, use the same constant (PCI_DEVICE_ID_DIGIUM_HFC4S) used in the device
ID table.

No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 4d85645c87f7..0928fd1f0e0c 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -4365,7 +4365,8 @@ setup_pci(struct hfc_multi *hc, struct pci_dev *pdev,
 	if (m->clock2)
 		test_and_set_bit(HFC_CHIP_CLOCK2, &hc->chip);
 
-	if (ent->device == 0xB410) {
+	if (ent->vendor == PCI_VENDOR_ID_DIGIUM &&
+	    ent->device == PCI_DEVICE_ID_DIGIUM_HFC4S) {
 		test_and_set_bit(HFC_CHIP_B410P, &hc->chip);
 		test_and_set_bit(HFC_CHIP_PCM_MASTER, &hc->chip);
 		test_and_clear_bit(HFC_CHIP_PCM_SLAVE, &hc->chip);
-- 
2.21.0.225.g810b269d1ac-goog


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

* Re: [PATCH] mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S
  2019-03-18 13:51 [PATCH] mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S helgaas
@ 2019-03-19  1:33 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-03-19  1:33 UTC (permalink / raw)
  To: helgaas; +Cc: isdn, netdev, linux-kernel, bhelgaas

From: helgaas@kernel.org
Date: Mon, 18 Mar 2019 08:51:06 -0500

> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> The device ID alone does not uniquely identify a device.  Test both the
> vendor and device ID to make sure we don't mistakenly think some other
> vendor's 0xB410 device is a Digium HFC4S.  Also, instead of the bare hex
> ID, use the same constant (PCI_DEVICE_ID_DIGIUM_HFC4S) used in the device
> ID table.
> 
> No functional change intended.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Applied, thanks.

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

end of thread, other threads:[~2019-03-19  1:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-18 13:51 [PATCH] mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S helgaas
2019-03-19  1:33 ` 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).