diff options
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r-- | drivers/pnp/resource.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 2a8612e31ab7..64387b70026a 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -628,6 +628,35 @@ struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, | |||
628 | return pnp_res; | 628 | return pnp_res; |
629 | } | 629 | } |
630 | 630 | ||
631 | struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, | ||
632 | resource_size_t start, | ||
633 | resource_size_t end, int flags) | ||
634 | { | ||
635 | struct pnp_resource *pnp_res; | ||
636 | struct resource *res; | ||
637 | static unsigned char warned; | ||
638 | |||
639 | pnp_res = pnp_new_resource(dev, IORESOURCE_IO); | ||
640 | if (!pnp_res) { | ||
641 | if (!warned) { | ||
642 | dev_err(&dev->dev, "can't add resource for IO " | ||
643 | "%#llx-%#llx\n",(unsigned long long) start, | ||
644 | (unsigned long long) end); | ||
645 | warned = 1; | ||
646 | } | ||
647 | return NULL; | ||
648 | } | ||
649 | |||
650 | res = &pnp_res->res; | ||
651 | res->flags = IORESOURCE_IO | flags; | ||
652 | res->start = start; | ||
653 | res->end = end; | ||
654 | |||
655 | dev_dbg(&dev->dev, " add io %#llx-%#llx flags %#x\n", | ||
656 | (unsigned long long) start, (unsigned long long) end, flags); | ||
657 | return pnp_res; | ||
658 | } | ||
659 | |||
631 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ | 660 | /* format is: pnp_reserve_irq=irq1[,irq2] .... */ |
632 | static int __init pnp_setup_reserve_irq(char *str) | 661 | static int __init pnp_setup_reserve_irq(char *str) |
633 | { | 662 | { |