#define PNP_MAX_IRQ 2
#define PNP_MAX_DMA 2
+struct pnp_resource {
+ struct resource res;
+};
+
struct pnp_resource_table {
- struct resource port_resource[PNP_MAX_PORT];
- struct resource mem_resource[PNP_MAX_MEM];
- struct resource dma_resource[PNP_MAX_DMA];
- struct resource irq_resource[PNP_MAX_IRQ];
+ struct pnp_resource port[PNP_MAX_PORT];
+ struct pnp_resource mem[PNP_MAX_MEM];
+ struct pnp_resource dma[PNP_MAX_DMA];
+ struct pnp_resource irq[PNP_MAX_IRQ];
};
int idx;
for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
- res = &dev->res->irq_resource[idx];
+ res = &dev->res->irq[idx].res;
res->flags = IORESOURCE_IRQ;
pnp_init_resource(res);
}
for (idx = 0; idx < PNP_MAX_DMA; idx++) {
- res = &dev->res->dma_resource[idx];
+ res = &dev->res->dma[idx].res;
res->flags = IORESOURCE_DMA;
pnp_init_resource(res);
}
for (idx = 0; idx < PNP_MAX_PORT; idx++) {
- res = &dev->res->port_resource[idx];
+ res = &dev->res->port[idx].res;
res->flags = IORESOURCE_IO;
pnp_init_resource(res);
}
for (idx = 0; idx < PNP_MAX_MEM; idx++) {
- res = &dev->res->mem_resource[idx];
+ res = &dev->res->mem[idx].res;
res->flags = IORESOURCE_MEM;
pnp_init_resource(res);
}
int idx;
for (idx = 0; idx < PNP_MAX_IRQ; idx++) {
- res = &dev->res->irq_resource[idx];
+ res = &dev->res->irq[idx].res;
if (res->flags & IORESOURCE_AUTO) {
res->flags = IORESOURCE_IRQ;
pnp_init_resource(res);
}
}
for (idx = 0; idx < PNP_MAX_DMA; idx++) {
- res = &dev->res->dma_resource[idx];
+ res = &dev->res->dma[idx].res;
if (res->flags & IORESOURCE_AUTO) {
res->flags = IORESOURCE_DMA;
pnp_init_resource(res);
}
}
for (idx = 0; idx < PNP_MAX_PORT; idx++) {
- res = &dev->res->port_resource[idx];
+ res = &dev->res->port[idx].res;
if (res->flags & IORESOURCE_AUTO) {
res->flags = IORESOURCE_IO;
pnp_init_resource(res);
}
}
for (idx = 0; idx < PNP_MAX_MEM; idx++) {
- res = &dev->res->mem_resource[idx];
+ res = &dev->res->mem[idx].res;
if (res->flags & IORESOURCE_AUTO) {
res->flags = IORESOURCE_MEM;
pnp_init_resource(res);
case IORESOURCE_IO:
if (num >= PNP_MAX_PORT)
return NULL;
- return &res->port_resource[num];
+ return &res->port[num].res;
case IORESOURCE_MEM:
if (num >= PNP_MAX_MEM)
return NULL;
- return &res->mem_resource[num];
+ return &res->mem[num].res;
case IORESOURCE_IRQ:
if (num >= PNP_MAX_IRQ)
return NULL;
- return &res->irq_resource[num];
+ return &res->irq[num].res;
case IORESOURCE_DMA:
if (num >= PNP_MAX_DMA)
return NULL;
- return &res->dma_resource[num];
+ return &res->dma[num].res;
}
return NULL;
}