aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index e5ae3a0c13bb..de5b9011d038 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -162,14 +162,9 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
162const struct pci_device_id *pci_match_device(struct pci_driver *drv, 162const struct pci_device_id *pci_match_device(struct pci_driver *drv,
163 struct pci_dev *dev) 163 struct pci_dev *dev)
164{ 164{
165 const struct pci_device_id *id;
166 struct pci_dynid *dynid; 165 struct pci_dynid *dynid;
167 166
168 id = pci_match_id(drv->id_table, dev); 167 /* Look at the dynamic ids first, before the static ones */
169 if (id)
170 return id;
171
172 /* static ids didn't match, lets look at the dynamic ones */
173 spin_lock(&drv->dynids.lock); 168 spin_lock(&drv->dynids.lock);
174 list_for_each_entry(dynid, &drv->dynids.list, node) { 169 list_for_each_entry(dynid, &drv->dynids.list, node) {
175 if (pci_match_one_device(&dynid->id, dev)) { 170 if (pci_match_one_device(&dynid->id, dev)) {
@@ -178,7 +173,8 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv,
178 } 173 }
179 } 174 }
180 spin_unlock(&drv->dynids.lock); 175 spin_unlock(&drv->dynids.lock);
181 return NULL; 176
177 return pci_match_id(drv->id_table, dev);
182} 178}
183 179
184static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev, 180static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,