diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/pnp.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 8b607aecd959..dfaa567e04a8 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | struct pnp_protocol; | 16 | struct pnp_protocol; |
17 | struct pnp_dev; | 17 | struct pnp_dev; |
18 | struct pnp_resource_table; | ||
19 | 18 | ||
20 | /* | 19 | /* |
21 | * Resource Management | 20 | * Resource Management |
@@ -24,7 +23,14 @@ struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); | |||
24 | 23 | ||
25 | static inline int pnp_resource_valid(struct resource *res) | 24 | static inline int pnp_resource_valid(struct resource *res) |
26 | { | 25 | { |
27 | if (res && !(res->flags & IORESOURCE_UNSET)) | 26 | if (res) |
27 | return 1; | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | static inline int pnp_resource_enabled(struct resource *res) | ||
32 | { | ||
33 | if (res && !(res->flags & IORESOURCE_DISABLED)) | ||
28 | return 1; | 34 | return 1; |
29 | return 0; | 35 | return 0; |
30 | } | 36 | } |
@@ -64,7 +70,7 @@ static inline unsigned long pnp_port_flags(struct pnp_dev *dev, | |||
64 | 70 | ||
65 | if (pnp_resource_valid(res)) | 71 | if (pnp_resource_valid(res)) |
66 | return res->flags; | 72 | return res->flags; |
67 | return IORESOURCE_IO | IORESOURCE_AUTO | IORESOURCE_UNSET; | 73 | return IORESOURCE_IO | IORESOURCE_AUTO; |
68 | } | 74 | } |
69 | 75 | ||
70 | static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar) | 76 | static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar) |
@@ -109,7 +115,7 @@ static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar) | |||
109 | 115 | ||
110 | if (pnp_resource_valid(res)) | 116 | if (pnp_resource_valid(res)) |
111 | return res->flags; | 117 | return res->flags; |
112 | return IORESOURCE_MEM | IORESOURCE_AUTO | IORESOURCE_UNSET; | 118 | return IORESOURCE_MEM | IORESOURCE_AUTO; |
113 | } | 119 | } |
114 | 120 | ||
115 | static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar) | 121 | static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar) |
@@ -143,7 +149,7 @@ static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar) | |||
143 | 149 | ||
144 | if (pnp_resource_valid(res)) | 150 | if (pnp_resource_valid(res)) |
145 | return res->flags; | 151 | return res->flags; |
146 | return IORESOURCE_IRQ | IORESOURCE_AUTO | IORESOURCE_UNSET; | 152 | return IORESOURCE_IRQ | IORESOURCE_AUTO; |
147 | } | 153 | } |
148 | 154 | ||
149 | static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar) | 155 | static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar) |
@@ -167,7 +173,7 @@ static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar) | |||
167 | 173 | ||
168 | if (pnp_resource_valid(res)) | 174 | if (pnp_resource_valid(res)) |
169 | return res->flags; | 175 | return res->flags; |
170 | return IORESOURCE_DMA | IORESOURCE_AUTO | IORESOURCE_UNSET; | 176 | return IORESOURCE_DMA | IORESOURCE_AUTO; |
171 | } | 177 | } |
172 | 178 | ||
173 | static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar) | 179 | static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar) |
@@ -296,7 +302,7 @@ struct pnp_dev { | |||
296 | int capabilities; | 302 | int capabilities; |
297 | struct pnp_option *independent; | 303 | struct pnp_option *independent; |
298 | struct pnp_option *dependent; | 304 | struct pnp_option *dependent; |
299 | struct pnp_resource_table *res; | 305 | struct list_head resources; |
300 | 306 | ||
301 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ | 307 | char name[PNP_NAME_LEN]; /* contains a human-readable name */ |
302 | int flags; /* used by protocols */ | 308 | int flags; /* used by protocols */ |