summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-06-09 22:41:35 +0000
committerMyles Watson <mylesgw@gmail.com>2010-06-09 22:41:35 +0000
commit894a34715f41f7c819a593dc3ff8e3033ffaa9fe (patch)
tree12ed2a5e10c6f181caa4c1add2ee8239abf82bfe /src/drivers
parent6507b390467591928f16aab68f247321ad3f2262 (diff)
downloadcoreboot-894a34715f41f7c819a593dc3ff8e3033ffaa9fe.tar.xz
Same conversion as with resources from static arrays to lists, except
there is no free list. Converting resource arrays to lists reduced the size of each device struct from 1092 to 228 bytes. Converting link arrays to lists reduced the size of each device struct from 228 to 68 bytes. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5626 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/generic/debug/debug_dev.c10
-rw-r--r--src/drivers/i2c/i2cmux/i2cmux.c2
-rw-r--r--src/drivers/i2c/i2cmux2/i2cmux2.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/drivers/generic/debug/debug_dev.c b/src/drivers/generic/debug/debug_dev.c
index 5c5dc8b16e..60d610fe40 100644
--- a/src/drivers/generic/debug/debug_dev.c
+++ b/src/drivers/generic/debug/debug_dev.c
@@ -85,7 +85,7 @@ static void print_cpuid(void)
static void print_smbus_regs(struct device *dev)
{
int j;
- printk(BIOS_DEBUG, "smbus: %s[%d]->", dev_path(dev->bus->dev), dev->bus->link);
+ printk(BIOS_DEBUG, "smbus: %s[%d]->", dev_path(dev->bus->dev), dev->bus->link_num);
printk(BIOS_DEBUG, "%s", dev_path(dev));
for(j = 0; j < 256; j++) {
int status;
@@ -107,22 +107,22 @@ static void print_smbus_regs(struct device *dev)
static void print_smbus_regs_all(struct device *dev)
{
struct device *child;
- int i;
+ struct bus *link;
if (dev->enabled && dev->path.type == DEVICE_PATH_I2C)
{
// Here don't need to call smbus_set_link, because we scan it from top to down
if( dev->bus->dev->path.type == DEVICE_PATH_I2C) { // it's under i2c MUX so set mux at first
if(ops_smbus_bus(get_pbus_smbus(dev->bus->dev))) {
if(dev->bus->dev->ops && dev->bus->dev->ops->set_link)
- dev->bus->dev->ops->set_link(dev->bus->dev, dev->bus->link);
+ dev->bus->dev->ops->set_link(dev->bus->dev, dev->bus->link_num);
}
}
if(ops_smbus_bus(get_pbus_smbus(dev))) print_smbus_regs(dev);
}
- for(i=0; i< dev->links; i++) {
- for (child = dev->link[i].children; child; child = child->sibling) {
+ for(link = dev->link_list; link; link = link->next) {
+ for (child = link->children; child; child = child->sibling) {
print_smbus_regs_all(child);
}
}
diff --git a/src/drivers/i2c/i2cmux/i2cmux.c b/src/drivers/i2c/i2cmux/i2cmux.c
index cd68a01ebf..14c52ccfd3 100644
--- a/src/drivers/i2c/i2cmux/i2cmux.c
+++ b/src/drivers/i2c/i2cmux/i2cmux.c
@@ -34,7 +34,7 @@ static struct device_operations i2cmux_operations = {
static void enable_dev(struct device *dev)
{
- if(dev->links>0)
+ if(dev->link_list != NULL)
dev->ops = &i2cmux_operations;
}
diff --git a/src/drivers/i2c/i2cmux2/i2cmux2.c b/src/drivers/i2c/i2cmux2/i2cmux2.c
index 4d2eeb99e6..c0f8e70878 100644
--- a/src/drivers/i2c/i2cmux2/i2cmux2.c
+++ b/src/drivers/i2c/i2cmux2/i2cmux2.c
@@ -33,7 +33,7 @@ static struct device_operations i2cmux2_operations = {
static void enable_dev(struct device *dev)
{
- if(dev->links>0)
+ if(dev->link_list != NULL)
dev->ops = &i2cmux2_operations;
}