login
Header Space

 
 

[patch 4/8] PNP: add pnp_resource_type() internal interface

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Len Brown <lenb@...>
Cc: <linux-acpi@...>, <linux-kernel@...>, Adam Belay <ambx1@...>, Adam M Belay <abelay@...>, Li Shaohua <shaohua.li@...>, Matthieu Castet <castet.matthieu@...>, Thomas Renninger <trenn@...>, Rene Herman <rene.herman@...>, Jaroslav Kysela <perex@...>, Andrew Morton <akpm@...>
Date: Monday, May 5, 2008 - 6:36 pm

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

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

Index: work10/drivers/pnp/base.h
===================================================================
--- work10.orig/drivers/pnp/base.h	2008-05-02 14:23:13.000000000 -0600
+++ work10/drivers/pnp/base.h	2008-05-05 09:39:03.000000000 -0600
@@ -45,6 +45,7 @@ int pnp_check_dma(struct pnp_dev *dev, s
 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);
Index: work10/drivers/pnp/resource.c
===================================================================
--- work10.orig/drivers/pnp/resource.c	2008-05-02 14:23:13.000000000 -0600
+++ work10/drivers/pnp/resource.c	2008-05-05 09:38:57.000000000 -0600
@@ -499,6 +499,12 @@ int pnp_check_dma(struct pnp_dev *dev, s
 #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)
 {

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

Messages in current thread:
[patch 4/8] PNP: add pnp_resource_type() internal interface, Bjorn Helgaas, (Mon May 5, 6:36 pm)
speck-geostationary