Message ID | 20201021081030.160-2-zhenzhong.duan@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | [1/2] PCI: export pci_match_device() | expand |
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);
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(-)