|
@@ -162,14 +162,9 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
|
|
const struct pci_device_id *pci_match_device(struct pci_driver *drv,
|
|
const struct pci_device_id *pci_match_device(struct pci_driver *drv,
|
|
struct pci_dev *dev)
|
|
struct pci_dev *dev)
|
|
{
|
|
{
|
|
- const struct pci_device_id *id;
|
|
|
|
struct pci_dynid *dynid;
|
|
struct pci_dynid *dynid;
|
|
|
|
|
|
- id = pci_match_id(drv->id_table, dev);
|
|
|
|
- if (id)
|
|
|
|
- return id;
|
|
|
|
-
|
|
|
|
- /* static ids didn't match, lets look at the dynamic ones */
|
|
|
|
|
|
+ /* Look at the dynamic ids first, before the static ones */
|
|
spin_lock(&drv->dynids.lock);
|
|
spin_lock(&drv->dynids.lock);
|
|
list_for_each_entry(dynid, &drv->dynids.list, node) {
|
|
list_for_each_entry(dynid, &drv->dynids.list, node) {
|
|
if (pci_match_one_device(&dynid->id, dev)) {
|
|
if (pci_match_one_device(&dynid->id, dev)) {
|
|
@@ -178,7 +173,8 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
spin_unlock(&drv->dynids.lock);
|
|
spin_unlock(&drv->dynids.lock);
|
|
- return NULL;
|
|
|
|
|
|
+
|
|
|
|
+ return pci_match_id(drv->id_table, dev);
|
|
}
|
|
}
|
|
|
|
|
|
static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
|
|
static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
|