summaryrefslogtreecommitdiffstats
path: root/drivers/pnp/resource.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-06-28 00:56:54 +0200
committerAndi Kleen <andi@basil.nowhere.org>2008-07-16 23:27:05 +0200
commit940e98dbc616f1df7b63b73858a966969baf261d (patch)
tree23d8a266017d983abbb2737e6f674e69104d16ab /drivers/pnp/resource.c
parentPNP: remove pnp_resource.index (diff)
downloadlinux-940e98dbc616f1df7b63b73858a966969baf261d.tar.xz
linux-940e98dbc616f1df7b63b73858a966969baf261d.zip
PNP: add pnp_resource_type() internal interface
Given a struct resource, this returns the type (IO, MEM, IRQ, DMA). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r--drivers/pnp/resource.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index 390b50096e30..cce341f743d4 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -499,6 +499,12 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
#endif
}
+int pnp_resource_type(struct resource *res)
+{
+ return res->flags & (IORESOURCE_IO | IORESOURCE_MEM |
+ IORESOURCE_IRQ | IORESOURCE_DMA);
+}
+
struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev,
unsigned int type, unsigned int num)
{