diff options
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r-- | drivers/pnp/resource.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 1f4134eea7b7..082a556b9dcc 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -576,6 +576,32 @@ static struct pnp_resource *pnp_new_resource(struct pnp_dev *dev, int type) | |||
576 | return NULL; | 576 | return NULL; |
577 | } | 577 | } |
578 | 578 | ||
579 | struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, | ||
580 | int flags) | ||
581 | { | ||
582 | struct pnp_resource *pnp_res; | ||
583 | struct resource *res; | ||
584 | static unsigned char warned; | ||
585 | |||
586 | pnp_res = pnp_new_resource(dev, IORESOURCE_IRQ); | ||
587 | if (!pnp_res) { | ||
588 | if (!warned) { | ||
589 | dev_err(&dev->dev, "can't add resource for IRQ %d\n", | ||
590 | irq); | ||
591 | warned = 1; | ||
592 | } | ||
593 | return NULL; | ||
594 | } | ||
595 | |||
596 | res = &pnp_res->res; | ||
597 | res->flags = IORESOURCE_IRQ | flags; | ||
598 | res->start = irq; | ||
599 | res->end = irq; | ||
600 | |||
601 | dev_dbg(&dev->dev, " add irq %d flags %#x\n", irq, flags); | ||
602 | return pnp_res; | ||
603 | } | ||
604 | |||
579 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ | 605 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ |
580 | static int __init pnp_setup_reserve_irq(char *str) | 606 | static int __init pnp_setup_reserve_irq(char *str) |
581 | { | 607 | { |