diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 18:34:35 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:28 -0400 |
commit | dc16f5f2ede8cc2acf8ac22857a7fecf3a4296c2 (patch) | |
tree | b4ba965b7c5e1e6011697160aa5346b63afbbbf9 /drivers/pnp/resource.c | |
parent | dbddd0383c59d588f8db5e773b062756e39117ec (diff) |
PNP: make generic pnp_add_dma_resource()
Add a pnp_add_dma_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.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 082a556b9dcc..2a8612e31ab7 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -602,6 +602,32 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, | |||
602 | return pnp_res; | 602 | return pnp_res; |
603 | } | 603 | } |
604 | 604 | ||
605 | struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, | ||
606 | int flags) | ||
607 | { | ||
608 | struct pnp_resource *pnp_res; | ||
609 | struct resource *res; | ||
610 | static unsigned char warned; | ||
611 | |||
612 | pnp_res = pnp_new_resource(dev, IORESOURCE_DMA); | ||
613 | if (!pnp_res) { | ||
614 | if (!warned) { | ||
615 | dev_err(&dev->dev, "can't add resource for DMA %d\n", | ||
616 | dma); | ||
617 | warned = 1; | ||
618 | } | ||
619 | return NULL; | ||
620 | } | ||
621 | |||
622 | res = &pnp_res->res; | ||
623 | res->flags = IORESOURCE_DMA | flags; | ||
624 | res->start = dma; | ||
625 | res->end = dma; | ||
626 | |||
627 | dev_dbg(&dev->dev, " add dma %d flags %#x\n", dma, flags); | ||
628 | return pnp_res; | ||
629 | } | ||
630 | |||
605 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ | 631 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ |
606 | static int __init pnp_setup_reserve_irq(char *str) | 632 | static int __init pnp_setup_reserve_irq(char *str) |
607 | { | 633 | { |