diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2008-04-28 16:34:34 -0600 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 03:22:28 -0400 |
commit | dbddd0383c59d588f8db5e773b062756e39117ec (patch) | |
tree | 77009fb218b4fc21090ae83105aa0f84664ae61c /drivers/pnp/interface.c | |
parent | a50b6d7b8d7e1a8b13bd1be65a865b115e1190d9 (diff) | |
download | linux-dbddd0383c59d588f8db5e773b062756e39117ec.tar.gz linux-dbddd0383c59d588f8db5e773b062756e39117ec.tar.bz2 linux-dbddd0383c59d588f8db5e773b062756e39117ec.zip |
PNP: make generic pnp_add_irq_resource()
Add a pnp_add_irq_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/interface.c')
-rw-r--r-- | drivers/pnp/interface.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c index ead151242a64..e8134c286207 100644 --- a/drivers/pnp/interface.c +++ b/drivers/pnp/interface.c @@ -324,6 +324,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, struct resource *res; char *buf = (void *)ubuf; int retval = 0; + resource_size_t start; if (dev->status & PNP_ATTACHED) { retval = -EBUSY; @@ -429,16 +430,10 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, buf += 3; while (isspace(*buf)) ++buf; - pnp_res = pnp_get_pnp_resource(dev, - IORESOURCE_IRQ, nirq); - if (!pnp_res) - break; - pnp_res->index = nirq; - res = &pnp_res->res; - res->start = res->end = - simple_strtoul(buf, &buf, 0); - res->flags = IORESOURCE_IRQ; - nirq++; + start = simple_strtoul(buf, &buf, 0); + pnp_res = pnp_add_irq_resource(dev, start, 0); + if (pnp_res) + nirq++; continue; } if (!strnicmp(buf, "dma", 3)) { |