summaryrefslogtreecommitdiff
path: root/src/superio/via/vt1211
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-05-21 14:33:48 +0000
committerMyles Watson <mylesgw@gmail.com>2010-05-21 14:33:48 +0000
commitc25cc11ae32e10a7d0c9f04c29bfb7eca4d9c210 (patch)
treefb5ada475647efc61ee1f51f50e3adad4ac74b6e /src/superio/via/vt1211
parentc5b87c8f895502b235e1619a23bd89dda955000e (diff)
downloadcoreboot-c25cc11ae32e10a7d0c9f04c29bfb7eca4d9c210.tar.xz
Use lists instead of arrays for resources in devices to reduce memory usage.
Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5576 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/superio/via/vt1211')
-rw-r--r--src/superio/via/vt1211/vt1211.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/superio/via/vt1211/vt1211.c b/src/superio/via/vt1211/vt1211.c
index 1b98ae666e..69b744f283 100644
--- a/src/superio/via/vt1211/vt1211.c
+++ b/src/superio/via/vt1211/vt1211.c
@@ -127,15 +127,13 @@ static void vt1211_pnp_enable_resources(device_t dev)
static void vt1211_pnp_set_resources(struct device *dev)
{
- int i;
- struct resource *resource;
+ struct resource *res;
#if CONFIG_CONSOLE_SERIAL8250 == 1
if( dev->path.pnp.device == 2 ){
- for( i = 0 ; i < dev->resources; i++){
- resource = &dev->resource[i];
- resource->flags |= IORESOURCE_STORED;
- report_resource_stored(dev, resource, "");
+ for(res = dev->resource_list; res; res = res->next){
+ res->flags |= IORESOURCE_STORED;
+ report_resource_stored(dev, res, "");
}
return;
}
@@ -145,34 +143,33 @@ static void vt1211_pnp_set_resources(struct device *dev)
pnp_set_logical_device(dev);
/* Paranoia says I should disable the device here... */
- for(i = 0; i < dev->resources; i++) {
- resource = &dev->resource[i];
- if (!(resource->flags & IORESOURCE_ASSIGNED)) {
+ for(res = dev->resource_list; res; res = res->next){
+ if (!(res->flags & IORESOURCE_ASSIGNED)) {
printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010Lx not assigned\n",
- dev_path(dev), dev->resource->index,
- resource_type(resource),
- resource->size);
+ dev_path(dev), res->index,
+ resource_type(res),
+ res->size);
continue;
}
/* Now store the resource */
- if (resource->flags & IORESOURCE_IO) {
- vt1211_set_iobase(dev, resource->index, resource->base);
+ if (res->flags & IORESOURCE_IO) {
+ vt1211_set_iobase(dev, res->index, res->base);
}
- else if (resource->flags & IORESOURCE_DRQ) {
- pnp_set_drq(dev, resource->index, resource->base);
+ else if (res->flags & IORESOURCE_DRQ) {
+ pnp_set_drq(dev, res->index, res->base);
}
- else if (resource->flags & IORESOURCE_IRQ) {
- pnp_set_irq(dev, resource->index, resource->base);
+ else if (res->flags & IORESOURCE_IRQ) {
+ pnp_set_irq(dev, res->index, res->base);
}
else {
printk(BIOS_ERR, "ERROR: %s %02lx unknown resource type\n",
- dev_path(dev), resource->index);
+ dev_path(dev), res->index);
return;
}
- resource->flags |= IORESOURCE_STORED;
+ res->flags |= IORESOURCE_STORED;
- report_resource_stored(dev, resource, "");
+ report_resource_stored(dev, res, "");
}
pnp_exit_ext_func_mode(dev);