aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/resource.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-04-28 18:34:22 -0400
committerLen Brown <len.brown@intel.com>2008-04-29 03:22:25 -0400
commitf5d94ff014cb7e6212f40fc6644f3fd68507df33 (patch)
treedc370a5b6167a5d325beb3536309e3953d1976a2 /drivers/pnp/resource.c
parentdb9eaeab3e7ab72d773820820f1ba33960ad24c4 (diff)
PNP: pass resources, not indexes, to pnp_check_port(), et al
The caller already has the struct resource pointer, so no need for pnp_check_port(), pnp_check_mem(), etc., to look it up again. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-By: Rene Herman <rene.herman@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/resource.c')
-rw-r--r--drivers/pnp/resource.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index eab16e5520ae..93bf45e01f2c 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -239,14 +239,13 @@ void pnp_free_option(struct pnp_option *option)
239#define cannot_compare(flags) \ 239#define cannot_compare(flags) \
240((flags) & (IORESOURCE_UNSET | IORESOURCE_DISABLED)) 240((flags) & (IORESOURCE_UNSET | IORESOURCE_DISABLED))
241 241
242int pnp_check_port(struct pnp_dev *dev, int idx) 242int pnp_check_port(struct pnp_dev *dev, struct resource *res)
243{ 243{
244 int i; 244 int i;
245 struct pnp_dev *tdev; 245 struct pnp_dev *tdev;
246 struct resource *res, *tres; 246 struct resource *tres;
247 resource_size_t *port, *end, *tport, *tend; 247 resource_size_t *port, *end, *tport, *tend;
248 248
249 res = &dev->res.port_resource[idx];
250 port = &res->start; 249 port = &res->start;
251 end = &res->end; 250 end = &res->end;
252 251
@@ -300,14 +299,13 @@ int pnp_check_port(struct pnp_dev *dev, int idx)
300 return 1; 299 return 1;
301} 300}
302 301
303int pnp_check_mem(struct pnp_dev *dev, int idx) 302int pnp_check_mem(struct pnp_dev *dev, struct resource *res)
304{ 303{
305 int i; 304 int i;
306 struct pnp_dev *tdev; 305 struct pnp_dev *tdev;
307 struct resource *res, *tres; 306 struct resource *tres;
308 resource_size_t *addr, *end, *taddr, *tend; 307 resource_size_t *addr, *end, *taddr, *tend;
309 308
310 res = &dev->res.mem_resource[idx];
311 addr = &res->start; 309 addr = &res->start;
312 end = &res->end; 310 end = &res->end;
313 311
@@ -366,14 +364,13 @@ static irqreturn_t pnp_test_handler(int irq, void *dev_id)
366 return IRQ_HANDLED; 364 return IRQ_HANDLED;
367} 365}
368 366
369int pnp_check_irq(struct pnp_dev *dev, int idx) 367int pnp_check_irq(struct pnp_dev *dev, struct resource *res)
370{ 368{
371 int i; 369 int i;
372 struct pnp_dev *tdev; 370 struct pnp_dev *tdev;
373 struct resource *res, *tres; 371 struct resource *tres;
374 resource_size_t *irq; 372 resource_size_t *irq;
375 373
376 res = &dev->res.irq_resource[idx];
377 irq = &res->start; 374 irq = &res->start;
378 375
379 /* if the resource doesn't exist, don't complain about it */ 376 /* if the resource doesn't exist, don't complain about it */
@@ -439,15 +436,14 @@ int pnp_check_irq(struct pnp_dev *dev, int idx)
439 return 1; 436 return 1;
440} 437}
441 438
442int pnp_check_dma(struct pnp_dev *dev, int idx) 439int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
443{ 440{
444#ifndef CONFIG_IA64 441#ifndef CONFIG_IA64
445 int i; 442 int i;
446 struct pnp_dev *tdev; 443 struct pnp_dev *tdev;
447 struct resource *res, *tres; 444 struct resource *tres;
448 resource_size_t *dma; 445 resource_size_t *dma;
449 446
450 res = &dev->res.dma_resource[idx];
451 dma = &res->start; 447 dma = &res->start;
452 448
453 /* if the resource doesn't exist, don't complain about it */ 449 /* if the resource doesn't exist, don't complain about it */