Skip to contentSkip to conversation

mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S

PATCH Applied [email protected] 2 participants 2 messages Mar 18, 2019 – Mar 19, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S

From: Bjorn Helgaas <[email protected]>

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.

---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/isdn/hardware/mISDN/hfcmulti.c +2 -1
index 4d85645c87f7..0928fd1f0e0c 100644
@@ -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);
Signature · 1 line
2.21.0.225.g810b269d1ac-goog
maintainer Applied
#1 lore raw

From: [email protected]
Date: Mon, 18 Mar 2019 08:51:06 -0500

Quoted 11 lines

From: Bjorn Helgaas <[email protected]>

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.

Applied, thanks.