aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/resource.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:34 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:28 -0400
commitdbddd0383c59d588f8db5e773b062756e39117ec (patch)
tree77009fb218b4fc21090ae83105aa0f84664ae61c /drivers/pnp/resource.c
parenta50b6d7b8d7e1a8b13bd1be65a865b115e1190d9 (diff)
PNP: make generic pnp_add_irq_resource()
Add a pnp_add_irq_resource() that can be used by all the PNP backends. This consolidates a little more pnp_resource_table knowledge into one place. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r--drivers/pnp/resource.c26
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
579struct 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] .... */
580static int __init pnp_setup_reserve_irq(char *str) 606static int __init pnp_setup_reserve_irq(char *str)
581{ 607{