X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fpci%2Fpci-driver.c;h=92d5e8db0de7b63f0c92a761551af5452db30673;hb=ebcccd14b73831fa7fbc197e1d2b9c710a65731e;hp=e5ae3a0c13bbcf08f724c8bfc990ddbc98c0f951;hpb=bae94d02371c402408a4edfb95e71e88dbd3e973;p=powerpc.git diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index e5ae3a0c13..92d5e8db0d 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c @@ -150,8 +150,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, } /** - * pci_match_device - Tell if a PCI device structure has a matching - * PCI device id structure + * pci_match_device - Tell if a PCI device structure has a matching PCI device id structure * @drv: the PCI driver to match against * @dev: the PCI device structure to match against * @@ -162,14 +161,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, struct pci_dev *dev) { - const struct pci_device_id *id; 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); list_for_each_entry(dynid, &drv->dynids.list, node) { if (pci_match_one_device(&dynid->id, dev)) { @@ -178,7 +172,8 @@ const struct pci_device_id *pci_match_device(struct pci_driver *drv, } } 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, @@ -357,6 +352,8 @@ static int pci_device_resume_early(struct device * dev) struct pci_dev * pci_dev = to_pci_dev(dev); struct pci_driver * drv = pci_dev->driver; + pci_fixup_device(pci_fixup_resume, pci_dev); + if (drv && drv->resume_early) error = drv->resume_early(pci_dev); return error;