[patch 44/53] PNP: add pnp_resource_type() internal interface

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bjorn Helgaas
Date: Friday, April 18, 2008 - 1:50 pm

Given a struct resource, this returns the type (IO, MEM, IRQ, DMA).

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: work8/drivers/pnp/base.h
===================================================================
--- work8.orig/drivers/pnp/base.h	2008-04-17 14:07:25.000000000 -0600
+++ work8/drivers/pnp/base.h	2008-04-17 14:07:37.000000000 -0600
@@ -18,6 +18,7 @@
 int pnp_check_dma(struct pnp_dev * dev, int idx);
 
 void pnp_init_resource(struct resource *res);
+int pnp_resource_type(struct resource *res);
 
 #define PNP_MAX_PORT		40
 #define PNP_MAX_MEM		24
Index: work8/drivers/pnp/resource.c
===================================================================
--- work8.orig/drivers/pnp/resource.c	2008-04-17 14:07:48.000000000 -0600
+++ work8/drivers/pnp/resource.c	2008-04-17 14:09:25.000000000 -0600
@@ -489,6 +489,12 @@
 #endif
 }
 
+int pnp_resource_type(struct resource *res)
+{
+	return res->flags & (IORESOURCE_IO  | IORESOURCE_MEM |
+			     IORESOURCE_IRQ | IORESOURCE_DMA);
+}
+
 struct resource *pnp_get_resource(struct pnp_dev *dev,
 				  unsigned int type, unsigned int num)
 {

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 44/53] PNP: add pnp_resource_type() internal interface, Bjorn Helgaas, (Fri Apr 18, 1:50 pm)