X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fpnp%2Fpnpbios%2Frsparser.c;h=79bce7b7574085e34d4fcddb4cd8a9189c459e06;hb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;hp=f990065e19f0fb913f23aae5f72315b5dde1d937;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index f990065e1..79bce7b75 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c @@ -8,6 +8,12 @@ #include #include +#ifdef CONFIG_PCI +#include +#else +inline void pcibios_penalize_isa_irq(int irq) {} +#endif /* CONFIG_PCI */ + #include "pnpbios.h" /* standard resource tags */ @@ -58,6 +64,7 @@ pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq) } res->irq_resource[i].start = res->irq_resource[i].end = (unsigned long) irq; + pcibios_penalize_isa_irq(irq); } } @@ -65,7 +72,9 @@ static void pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma) { int i = 0; - while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_DMA) i++; + while (i < PNP_MAX_DMA && + !(res->dma_resource[i].flags & IORESOURCE_UNSET)) + i++; if (i < PNP_MAX_DMA) { res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag if (dma == -1) { @@ -285,10 +294,13 @@ static void pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_irq * irq; + unsigned long bits; + irq = pnpbios_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); if (!irq) return; - irq->map = (p[2] << 8) | p[1]; + bits = (p[2] << 8) | p[1]; + bitmap_copy(irq->map, &bits, 16); if (size > 2) irq->flags = p[3]; else @@ -346,12 +358,12 @@ pnpbios_parse_resource_option_data(unsigned char * p, unsigned char * end, struc { unsigned int len, tag; int priority = 0; - struct pnp_option *option; + struct pnp_option *option, *option_independent; if (!p) return NULL; - option = pnp_register_independent_option(dev); + option_independent = option = pnp_register_independent_option(dev); if (!option) return NULL; @@ -428,9 +440,14 @@ pnpbios_parse_resource_option_data(unsigned char * p, unsigned char * end, struc case SMALL_TAG_ENDDEP: if (len != 0) goto len_err; + if (option_independent == option) + printk(KERN_WARNING "PnPBIOS: Missing SMALL_TAG_STARTDEP tag\n"); + option = option_independent; break; case SMALL_TAG_END: + if (option_independent != option) + printk(KERN_WARNING "PnPBIOS: Missing SMALL_TAG_ENDDEP tag\n"); p = p + 2; return (unsigned char *)p; break;