summaryrefslogtreecommitdiff
path: root/src/devices/root_device.c
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-06-17 16:16:56 +0000
committerMyles Watson <mylesgw@gmail.com>2010-06-17 16:16:56 +0000
commit7eac4450b32f6961d5abd8dae32c5eefc1a07c11 (patch)
tree455e0181fea42d7c6bab09878ef35dc666789977 /src/devices/root_device.c
parente10757ed525cdd1a5263b9d79e284310c999c0f7 (diff)
downloadcoreboot-7eac4450b32f6961d5abd8dae32c5eefc1a07c11.tar.xz
Always enable parent resources before child resources.
Always initialize parents before children. Move s2881 code into a driver. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5633 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/root_device.c')
-rw-r--r--src/devices/root_device.c37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/devices/root_device.c b/src/devices/root_device.c
index a77b5c8b62..cd576a15b6 100644
--- a/src/devices/root_device.c
+++ b/src/devices/root_device.c
@@ -32,7 +32,7 @@
* that encompass the resources for the entire system.
* @param root Pointer to the device structure for the system root device
*/
-void root_dev_read_resources(device_t root)
+static void root_dev_read_resources(device_t root)
{
printk(BIOS_ERR, "%s should never be called.\n", __func__);
}
@@ -44,7 +44,7 @@ void root_dev_read_resources(device_t root)
* and every device under it which are all of the devices.
* @param root Pointer to the device structure for the system root device
*/
-void root_dev_set_resources(device_t root)
+static void root_dev_set_resources(device_t root)
{
printk(BIOS_ERR, "%s should never be called.\n", __func__);
}
@@ -115,33 +115,8 @@ unsigned int scan_static_bus(device_t bus, unsigned int max)
return max;
}
-/**
- * @brief Enable resources for children devices
- *
- * @param dev the device whos children's resources are to be enabled
- *
- * This function is called by the global enable_resource() indirectly via the
- * device_operation::enable_resources() method of devices.
- *
- * Indirect mutual recursion:
- * enable_childrens_resources() -> enable_resources()
- * enable_resources() -> device_operation::enable_resources()
- * device_operation::enable_resources() -> enable_children_resources()
- */
-void enable_childrens_resources(device_t dev)
-{
- struct bus *link;
- for(link = dev->link_list; link; link = link->next) {
- device_t child;
- for(child = link->children; child; child = child->sibling) {
- enable_resources(child);
- }
- }
-}
-
-void root_dev_enable_resources(device_t dev)
+static void root_dev_enable_resources(device_t dev)
{
- enable_childrens_resources(dev);
}
/**
@@ -152,16 +127,16 @@ void root_dev_enable_resources(device_t dev)
*
* This function is the default scan_bus() method of the root device.
*/
-unsigned int root_dev_scan_bus(device_t root, unsigned int max)
+static unsigned int root_dev_scan_bus(device_t root, unsigned int max)
{
return scan_static_bus(root, max);
}
-void root_dev_init(device_t root)
+static void root_dev_init(device_t root)
{
}
-void root_dev_reset(struct bus *bus)
+static void root_dev_reset(struct bus *bus)
{
printk(BIOS_INFO, "Reseting board...\n");
hard_reset();