summaryrefslogtreecommitdiff
path: root/src/devices/pci_device.c
diff options
context:
space:
mode:
authorLi-Ta Lo <ollie@lanl.gov>2004-05-05 21:15:42 +0000
committerLi-Ta Lo <ollie@lanl.gov>2004-05-05 21:15:42 +0000
commit9782f7538c3a7c0623d2177d10cc7785336da47c (patch)
treef5b667044771e5a490ceed4f289b4fe0f1312c06 /src/devices/pci_device.c
parent7ccff4ea0c1773e57b380cf7477febd64b58afea (diff)
downloadcoreboot-9782f7538c3a7c0623d2177d10cc7785336da47c.tar.xz
code refromat, doxidization
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1547 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/pci_device.c')
-rw-r--r--src/devices/pci_device.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c
index 4a248224cb..ec48e7f852 100644
--- a/src/devices/pci_device.c
+++ b/src/devices/pci_device.c
@@ -562,7 +562,7 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
post_code(0x24);
- /* probe all devices on this bus with some optimization for
+ /* probe all devices/functions on this bus with some optimization for
* non-existence and single funcion devices */
for (devfn = min_devfn; devfn <= max_devfn; devfn++) {
uint32_t id, class;
@@ -602,13 +602,15 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
* device */
/* FIXME: What happen if this PCI device listed as
* static device but does not exist ? This calls
- * some arbitray code without any justification */
+ * some arbitray code without any justification
+ * Also, it calls the enable function regardlessly
+ * the value of dev->enabled */
if (dev->chip && dev->chip->control &&
dev->chip->control->enable_dev) {
- int enable = dev->enabled;
+ int enabled = dev->enabled;
dev->enabled = 1;
dev->chip->control->enable_dev(dev);
- dev->enabled = enable;
+ dev->enabled = enabled;
}
/* Now read the vendor and device id */
id = pci_read_config32(dev, PCI_VENDOR_ID);
@@ -616,7 +618,7 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
/* Read the rest of the pci configuration information */
hdr_type = pci_read_config8(dev, PCI_HEADER_TYPE);
class = pci_read_config32(dev, PCI_CLASS_REVISION);
-
+
/* Store the interesting information in the device structure */
dev->vendor = id & 0xffff;
dev->device = (id >> 16) & 0xffff;
@@ -640,8 +642,8 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn,
/* Now run the magic enable/disable sequence for the device */
if (dev->ops && dev->ops->enable) {
dev->ops->enable(dev);
- }
- else if (dev->chip && dev->chip->control && dev->chip->control->enable_dev) {
+ } else if (dev->chip && dev->chip->control &&
+ dev->chip->control->enable_dev) {
dev->chip->control->enable_dev(dev);
}