PCI: remove unnecessary condition check in pci_restore_bars()
Remove the unnecessary number of resources condition checks because the pci_update_resource() will check availability of the resources. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
fde09c6d8f
commit
bc5f5a8277
1 changed files with 2 additions and 17 deletions
|
@ -376,24 +376,9 @@ pci_find_parent_resource(const struct pci_dev *dev, struct resource *res)
|
||||||
static void
|
static void
|
||||||
pci_restore_bars(struct pci_dev *dev)
|
pci_restore_bars(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
int i, numres;
|
int i;
|
||||||
|
|
||||||
switch (dev->hdr_type) {
|
for (i = 0; i < PCI_BRIDGE_RESOURCES; i++)
|
||||||
case PCI_HEADER_TYPE_NORMAL:
|
|
||||||
numres = 6;
|
|
||||||
break;
|
|
||||||
case PCI_HEADER_TYPE_BRIDGE:
|
|
||||||
numres = 2;
|
|
||||||
break;
|
|
||||||
case PCI_HEADER_TYPE_CARDBUS:
|
|
||||||
numres = 1;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* Should never get here, but just in case... */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < numres; i++)
|
|
||||||
pci_update_resource(dev, i);
|
pci_update_resource(dev, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue