This patch moves all the option allocations (pnp_mem, pnp_port, etc)
into the pnp_register_{mem,port,irq,dma}_resource() functions. This
will make it easier to rework the option data structures.
The non-trivial part of this patch is the IRQ handling. The backends
have to allocate a local pnp_irq_mask_t bitmap, populate it, and pass
a pointer to pnp_register_irq_resource().
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@xxxxxx>
Index: work10/drivers/pnp/isapnp/core.c
===================================================================
--- work10.orig/drivers/pnp/isapnp/core.c 2008-05-30 13:20:36.000000000 -0600
+++ work10/drivers/pnp/isapnp/core.c 2008-05-30 13:23:34.000000000 -0600
@@ -433,20 +433,23 @@ static void __init isapnp_parse_irq_reso
int size)
{
unsigned char tmp[3];
- struct pnp_irq *irq;
unsigned long bits;
+ int i;
+ pnp_irq_mask_t map;
+ unsigned char flags = IORESOURCE_IRQ_HIGHEDGE;
isapnp_peek(tmp, size);
- irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL);
- if (!irq)
- return;
bits = (tmp[1] << 8) | tmp[0];
- bitmap_copy(irq->map.bits, &bits, 16);
+
+ bitmap_zero(map.bits, PNP_IRQ_NR);
+ for (i = 0; i < 15; i++)
+ if (bits & (1 << i))
+ __set_bit(i, map.bits);
+
static __init void pnpbios_parse_port_option(struct pnp_dev *dev,
unsigned char *p, int size,
struct pnp_option *option)
{
- struct pnp_port *port;
+ resource_size_t min, max, align, len, flags;