Re: [patch 44/54] PNP: add pnp_new_resource() to find a new unset pnp_resource

Rene Herman
2008-04-26T22:37:38Z

On 25-04-08 20:38, Bjorn Helgaas wrote:

> + switch (type) {
> + case IORESOURCE_IO:
> + for (i = 0; i < PNP_MAX_PORT; i++) {
> + pnp_res = &dev->res->port[i];
> + res = &pnp_res->res;
> + if (res->flags & IORESOURCE_UNSET)
> + return pnp_res;

Again possible users of pnp_resource_valid().

> + }
> + break;
> + case IORESOURCE_MEM:
> + for (i = 0; i < PNP_MAX_MEM; i++) {
> + pnp_res = &dev->res->mem[i];
> + res = &pnp_res->res;
> + if (res->flags & IORESOURCE_UNSET)
> + return pnp_res;
> + }
> + break;
> + case IORESOURCE_IRQ:
> + for (i = 0; i < PNP_MAX_IRQ; i++) {
> + pnp_res = &dev->res->irq[i];
> + res = &pnp_res->res;
> + if (res->flags & IORESOURCE_UNSET)
> + return pnp_res;
> + }
> + break;
> + case IORESOURCE_DMA:
> + for (i = 0; i < PNP_MAX_DMA; i++) {
> + pnp_res = &dev->res->dma[i];
> + res = &pnp_res->res;
> + if (res->flags & IORESOURCE_UNSET)
> + return pnp_res;
> + }
> + break;
> + }
> + return NULL;
> +}
> +

Rene