diff mbox series

[2/2] PCI: add support for dynamic ID when checking for duplicate IDs

Message ID 20201021081030.160-2-zhenzhong.duan@gmail.com
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series [1/2] PCI: export pci_match_device() | expand

Commit Message

Zhenzhong Duan Oct. 21, 2020, 8:10 a.m. UTC
When a device ID data is writen to /sys/bus/pci/drivers/.../new_id,
only static ID table is checked for duplicate and multiple dynamic id
entries of same kind are allowed to be dynamically linked.

Fix it by calling pci_match_device() which checks both dynamic and static IDs.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
---
 drivers/pci/pci-driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index bd9cfd1..751c605 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -125,7 +125,7 @@  static ssize_t new_id_store(struct device_driver *driver, const char *buf,
 		pdev->subsystem_device = subdevice;
 		pdev->class = class;
 
-		if (pci_match_id(pdrv->id_table, pdev))
+		if (pci_match_device(pdrv, pdev))
 			retval = -EEXIST;
 
 		kfree(pdev);