diff options
Diffstat (limited to 'drivers/pnp/resource.c')
| -rw-r--r-- | drivers/pnp/resource.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 64d0596bafb5..5b277dbaacde 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
| @@ -470,7 +470,8 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res) | |||
| 470 | unsigned long pnp_resource_type(struct resource *res) | 470 | unsigned long pnp_resource_type(struct resource *res) |
| 471 | { | 471 | { |
| 472 | return res->flags & (IORESOURCE_IO | IORESOURCE_MEM | | 472 | return res->flags & (IORESOURCE_IO | IORESOURCE_MEM | |
| 473 | IORESOURCE_IRQ | IORESOURCE_DMA); | 473 | IORESOURCE_IRQ | IORESOURCE_DMA | |
| 474 | IORESOURCE_BUS); | ||
| 474 | } | 475 | } |
| 475 | 476 | ||
| 476 | struct resource *pnp_get_resource(struct pnp_dev *dev, | 477 | struct resource *pnp_get_resource(struct pnp_dev *dev, |
| @@ -590,6 +591,30 @@ struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, | |||
| 590 | return pnp_res; | 591 | return pnp_res; |
| 591 | } | 592 | } |
| 592 | 593 | ||
| 594 | struct pnp_resource *pnp_add_bus_resource(struct pnp_dev *dev, | ||
| 595 | resource_size_t start, | ||
| 596 | resource_size_t end) | ||
| 597 | { | ||
| 598 | struct pnp_resource *pnp_res; | ||
| 599 | struct resource *res; | ||
| 600 | |||
| 601 | pnp_res = pnp_new_resource(dev); | ||
| 602 | if (!pnp_res) { | ||
| 603 | dev_err(&dev->dev, "can't add resource for BUS %#llx-%#llx\n", | ||
| 604 | (unsigned long long) start, | ||
| 605 | (unsigned long long) end); | ||
| 606 | return NULL; | ||
| 607 | } | ||
| 608 | |||
| 609 | res = &pnp_res->res; | ||
| 610 | res->flags = IORESOURCE_BUS; | ||
| 611 | res->start = start; | ||
| 612 | res->end = end; | ||
| 613 | |||
| 614 | pnp_dbg(&dev->dev, " add %pr\n", res); | ||
| 615 | return pnp_res; | ||
| 616 | } | ||
| 617 | |||
| 593 | /* | 618 | /* |
| 594 | * Determine whether the specified resource is a possible configuration | 619 | * Determine whether the specified resource is a possible configuration |
| 595 | * for this device. | 620 | * for this device. |
