From: Bjorn Helgaas Date: Fri, 27 Jun 2008 22:56:54 +0000 (-0600) Subject: PNP: add pnp_resource_type() internal interface X-Git-Tag: v2.6.27-rc1~1050^2~28 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=940e98dbc616f1df7b63b73858a966969baf261d;p=linux-2.6-omap-h63xx.git PNP: add pnp_resource_type() internal interface Given a struct resource, this returns the type (IO, MEM, IRQ, DMA). Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown Signed-off-by: Andi Kleen --- diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 6f60097c421..4c2a6256499 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h @@ -46,6 +46,7 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res); void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); void pnp_init_resource(struct resource *res); +int pnp_resource_type(struct resource *res); struct pnp_resource *pnp_get_pnp_resource(struct pnp_dev *dev, unsigned int type, unsigned int num); diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 390b50096e3..cce341f743d 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) {