aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/resource.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index eee6d8eddcb4..ef8835ec5778 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -487,6 +487,33 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
487#endif 487#endif
488} 488}
489 489
490struct resource *pnp_get_resource(struct pnp_dev *dev,
491 unsigned int type, unsigned int num)
492{
493 struct pnp_resource_table *res = &dev->res;
494
495 switch (type) {
496 case IORESOURCE_IO:
497 if (num >= PNP_MAX_PORT)
498 return NULL;
499 return &res->port_resource[num];
500 case IORESOURCE_MEM:
501 if (num >= PNP_MAX_MEM)
502 return NULL;
503 return &res->mem_resource[num];
504 case IORESOURCE_IRQ:
505 if (num >= PNP_MAX_IRQ)
506 return NULL;
507 return &res->irq_resource[num];
508 case IORESOURCE_DMA:
509 if (num >= PNP_MAX_DMA)
510 return NULL;
511 return &res->dma_resource[num];
512 }
513 return NULL;
514}
515EXPORT_SYMBOL(pnp_get_resource);
516
490/* format is: pnp_reserve_irq=irq1[,irq2] .... */ 517/* format is: pnp_reserve_irq=irq1[,irq2] .... */
491static int __init pnp_setup_reserve_irq(char *str) 518static int __init pnp_setup_reserve_irq(char *str)
492{ 519{