lkml.org 
[lkml]   [2008]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 44/53] 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>

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)
{
--


\
 
 \ /
  Last update: 2008-04-18 23:13    [W:0.227 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site