diff options
author | Myles Watson <mylesgw@gmail.com> | 2010-06-09 22:41:35 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-06-09 22:41:35 +0000 |
commit | 894a34715f41f7c819a593dc3ff8e3033ffaa9fe (patch) | |
tree | 12ed2a5e10c6f181caa4c1add2ee8239abf82bfe /src/southbridge/nvidia/ck804 | |
parent | 6507b390467591928f16aab68f247321ad3f2262 (diff) |
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/southbridge/nvidia/ck804')
-rw-r--r-- | src/southbridge/nvidia/ck804/ck804_lpc.c | 6 | ||||
-rw-r--r-- | src/southbridge/nvidia/ck804/ck804_smbus.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/southbridge/nvidia/ck804/ck804_lpc.c b/src/southbridge/nvidia/ck804/ck804_lpc.c index a6637cad1c..e626400557 100644 --- a/src/southbridge/nvidia/ck804/ck804_lpc.c +++ b/src/southbridge/nvidia/ck804/ck804_lpc.c @@ -231,15 +231,15 @@ static void ck804_lpc_read_resources(device_t dev) */ static void ck804_lpc_enable_childrens_resources(device_t dev) { - unsigned link; + struct bus *link; uint32_t reg, reg_var[4]; int i, var_num = 0; reg = pci_read_config32(dev, 0xa0); - for (link = 0; link < dev->links; link++) { + for (link = dev->link_list; link; link = link->next) { device_t child; - for (child = dev->link[link].children; child; child = child->sibling) { + for (child = link->children; child; child = child->sibling) { enable_resources(child); if (child->enabled && (child->path.type == DEVICE_PATH_PNP)) { struct resource *res; diff --git a/src/southbridge/nvidia/ck804/ck804_smbus.c b/src/southbridge/nvidia/ck804/ck804_smbus.c index 3d8c9cee77..cc75a10703 100644 --- a/src/southbridge/nvidia/ck804/ck804_smbus.c +++ b/src/southbridge/nvidia/ck804/ck804_smbus.c @@ -23,7 +23,7 @@ static int lsmbus_recv_byte(device_t dev) device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); - res = find_resource(pbus->dev, 0x20 + (pbus->link * 4)); + res = find_resource(pbus->dev, 0x20 + (pbus->link_num * 4)); return do_smbus_recv_byte(res->base, device); } @@ -37,7 +37,7 @@ static int lsmbus_send_byte(device_t dev, uint8_t val) device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); - res = find_resource(pbus->dev, 0x20 + (pbus->link * 4)); + res = find_resource(pbus->dev, 0x20 + (pbus->link_num * 4)); return do_smbus_send_byte(res->base, device, val); } @@ -51,7 +51,7 @@ static int lsmbus_read_byte(device_t dev, uint8_t address) device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); - res = find_resource(pbus->dev, 0x20 + (pbus->link * 4)); + res = find_resource(pbus->dev, 0x20 + (pbus->link_num * 4)); return do_smbus_read_byte(res->base, device, address); } @@ -65,7 +65,7 @@ static int lsmbus_write_byte(device_t dev, uint8_t address, uint8_t val) device = dev->path.i2c.device; pbus = get_pbus_smbus(dev); - res = find_resource(pbus->dev, 0x20 + (pbus->link * 4)); + res = find_resource(pbus->dev, 0x20 + (pbus->link_num * 4)); return do_smbus_write_byte(res->base, device, address, val); } |