Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95568
b: refs/heads/master
c: b90eca0
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Apr 29, 2008
1 parent fc57271 commit cac13a7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d948a8daa059cf5b3e7f002e7b92acf00fc70c49
refs/heads/master: b90eca0a61ebd010036242e29610bc6a909e3f19
27 changes: 27 additions & 0 deletions trunk/drivers/pnp/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,33 @@ int pnp_check_dma(struct pnp_dev *dev, int idx)
#endif
}

struct resource *pnp_get_resource(struct pnp_dev *dev,
unsigned int type, unsigned int num)
{
struct pnp_resource_table *res = &dev->res;

switch (type) {
case IORESOURCE_IO:
if (num >= PNP_MAX_PORT)
return NULL;
return &res->port_resource[num];
case IORESOURCE_MEM:
if (num >= PNP_MAX_MEM)
return NULL;
return &res->mem_resource[num];
case IORESOURCE_IRQ:
if (num >= PNP_MAX_IRQ)
return NULL;
return &res->irq_resource[num];
case IORESOURCE_DMA:
if (num >= PNP_MAX_DMA)
return NULL;
return &res->dma_resource[num];
}
return NULL;
}
EXPORT_SYMBOL(pnp_get_resource);

/* format is: pnp_reserve_irq=irq1[,irq2] .... */
static int __init pnp_setup_reserve_irq(char *str)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pnp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct pnp_dev;
/*
* Resource Management
*/
struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);

/* Use these instead of directly reading pnp_dev to get resource information */
#define pnp_port_start(dev,bar) ((dev)->res.port_resource[(bar)].start)
Expand Down

0 comments on commit cac13a7

Please sign in to comment.