diff options
author | Yu Zhao <yu.zhao@intel.com> | 2008-11-21 13:40:00 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-01-07 14:13:01 -0500 |
commit | bc5f5a8277cb353161454b6704b3186ebcf3a2a3 (patch) | |
tree | 1f6410cbb69eb36f793ef09072b0bac890f15de6 /drivers/pci | |
parent | fde09c6d8f92de0c9f75698a75f0989f2234c517 (diff) |
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>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c3ef2e78fc58..deeab19d7d10 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -376,24 +376,9 @@ pci_find_parent_resource(const struct pci_dev *dev, struct resource *res) | |||
376 | static void | 376 | static void |
377 | pci_restore_bars(struct pci_dev *dev) | 377 | pci_restore_bars(struct pci_dev *dev) |
378 | { | 378 | { |
379 | int i, numres; | 379 | int i; |
380 | |||
381 | switch (dev->hdr_type) { | ||
382 | case PCI_HEADER_TYPE_NORMAL: | ||
383 | numres = 6; | ||
384 | break; | ||
385 | case PCI_HEADER_TYPE_BRIDGE: | ||
386 | numres = 2; | ||
387 | break; | ||
388 | case PCI_HEADER_TYPE_CARDBUS: | ||
389 | numres = 1; | ||
390 | break; | ||
391 | default: | ||
392 | /* Should never get here, but just in case... */ | ||
393 | return; | ||
394 | } | ||
395 | 380 | ||
396 | for (i = 0; i < numres; i++) | 381 | for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) |
397 | pci_update_resource(dev, i); | 382 | pci_update_resource(dev, i); |
398 | } | 383 | } |
399 | 384 | ||