diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-05-10 13:40:51 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-11 12:19:02 -0400 |
commit | 10bdaaa0fad620145cf10e2b573266b2d80b44de (patch) | |
tree | 8d3200f5041ab0fdc72e9245ef780310b27a18d8 /drivers/scsi/arm | |
parent | c7b87f3d5037a35b5c7bb916ffc826be3fcb208d (diff) |
[ARM] ecard: add ecardm_iomap() / ecardm_iounmap()
Add devres ecardm_iomap() and ecardm_iounmap() for Acorn expansion
cards. Convert all expansion card drivers to use them.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r-- | drivers/scsi/arm/arxescsi.c | 12 | ||||
-rw-r--r-- | drivers/scsi/arm/cumana_2.c | 12 | ||||
-rw-r--r-- | drivers/scsi/arm/eesox.c | 12 | ||||
-rw-r--r-- | drivers/scsi/arm/powertec.c | 12 |
4 files changed, 8 insertions, 40 deletions
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c index 7e132c5bacf8..2836fe248df9 100644 --- a/drivers/scsi/arm/arxescsi.c +++ b/drivers/scsi/arm/arxescsi.c | |||
@@ -281,7 +281,6 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
281 | { | 281 | { |
282 | struct Scsi_Host *host; | 282 | struct Scsi_Host *host; |
283 | struct arxescsi_info *info; | 283 | struct arxescsi_info *info; |
284 | unsigned long resbase, reslen; | ||
285 | void __iomem *base; | 284 | void __iomem *base; |
286 | int ret; | 285 | int ret; |
287 | 286 | ||
@@ -289,9 +288,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
289 | if (ret) | 288 | if (ret) |
290 | goto out; | 289 | goto out; |
291 | 290 | ||
292 | resbase = ecard_resource_start(ec, ECARD_RES_MEMC); | 291 | base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0); |
293 | reslen = ecard_resource_len(ec, ECARD_RES_MEMC); | ||
294 | base = ioremap(resbase, reslen); | ||
295 | if (!base) { | 292 | if (!base) { |
296 | ret = -ENOMEM; | 293 | ret = -ENOMEM; |
297 | goto out_region; | 294 | goto out_region; |
@@ -300,7 +297,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
300 | host = scsi_host_alloc(&arxescsi_template, sizeof(struct arxescsi_info)); | 297 | host = scsi_host_alloc(&arxescsi_template, sizeof(struct arxescsi_info)); |
301 | if (!host) { | 298 | if (!host) { |
302 | ret = -ENOMEM; | 299 | ret = -ENOMEM; |
303 | goto out_unmap; | 300 | goto out_region; |
304 | } | 301 | } |
305 | 302 | ||
306 | info = (struct arxescsi_info *)host->hostdata; | 303 | info = (struct arxescsi_info *)host->hostdata; |
@@ -337,8 +334,6 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
337 | fas216_release(host); | 334 | fas216_release(host); |
338 | out_unregister: | 335 | out_unregister: |
339 | scsi_host_put(host); | 336 | scsi_host_put(host); |
340 | out_unmap: | ||
341 | iounmap(base); | ||
342 | out_region: | 337 | out_region: |
343 | ecard_release_resources(ec); | 338 | ecard_release_resources(ec); |
344 | out: | 339 | out: |
@@ -348,13 +343,10 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
348 | static void __devexit arxescsi_remove(struct expansion_card *ec) | 343 | static void __devexit arxescsi_remove(struct expansion_card *ec) |
349 | { | 344 | { |
350 | struct Scsi_Host *host = ecard_get_drvdata(ec); | 345 | struct Scsi_Host *host = ecard_get_drvdata(ec); |
351 | struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata; | ||
352 | 346 | ||
353 | ecard_set_drvdata(ec, NULL); | 347 | ecard_set_drvdata(ec, NULL); |
354 | fas216_remove(host); | 348 | fas216_remove(host); |
355 | 349 | ||
356 | iounmap(info->base); | ||
357 | |||
358 | fas216_release(host); | 350 | fas216_release(host); |
359 | scsi_host_put(host); | 351 | scsi_host_put(host); |
360 | ecard_release_resources(ec); | 352 | ecard_release_resources(ec); |
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c index f51aa3446bc7..68a64123af8f 100644 --- a/drivers/scsi/arm/cumana_2.c +++ b/drivers/scsi/arm/cumana_2.c | |||
@@ -401,7 +401,6 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
401 | { | 401 | { |
402 | struct Scsi_Host *host; | 402 | struct Scsi_Host *host; |
403 | struct cumanascsi2_info *info; | 403 | struct cumanascsi2_info *info; |
404 | unsigned long resbase, reslen; | ||
405 | void __iomem *base; | 404 | void __iomem *base; |
406 | int ret; | 405 | int ret; |
407 | 406 | ||
@@ -409,9 +408,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
409 | if (ret) | 408 | if (ret) |
410 | goto out; | 409 | goto out; |
411 | 410 | ||
412 | resbase = ecard_resource_start(ec, ECARD_RES_MEMC); | 411 | base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0); |
413 | reslen = ecard_resource_len(ec, ECARD_RES_MEMC); | ||
414 | base = ioremap(resbase, reslen); | ||
415 | if (!base) { | 412 | if (!base) { |
416 | ret = -ENOMEM; | 413 | ret = -ENOMEM; |
417 | goto out_region; | 414 | goto out_region; |
@@ -421,7 +418,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
421 | sizeof(struct cumanascsi2_info)); | 418 | sizeof(struct cumanascsi2_info)); |
422 | if (!host) { | 419 | if (!host) { |
423 | ret = -ENOMEM; | 420 | ret = -ENOMEM; |
424 | goto out_unmap; | 421 | goto out_region; |
425 | } | 422 | } |
426 | 423 | ||
427 | ecard_set_drvdata(ec, host); | 424 | ecard_set_drvdata(ec, host); |
@@ -490,9 +487,6 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
490 | out_free: | 487 | out_free: |
491 | scsi_host_put(host); | 488 | scsi_host_put(host); |
492 | 489 | ||
493 | out_unmap: | ||
494 | iounmap(base); | ||
495 | |||
496 | out_region: | 490 | out_region: |
497 | ecard_release_resources(ec); | 491 | ecard_release_resources(ec); |
498 | 492 | ||
@@ -512,8 +506,6 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec) | |||
512 | free_dma(info->info.scsi.dma); | 506 | free_dma(info->info.scsi.dma); |
513 | free_irq(ec->irq, info); | 507 | free_irq(ec->irq, info); |
514 | 508 | ||
515 | iounmap(info->base); | ||
516 | |||
517 | fas216_release(host); | 509 | fas216_release(host); |
518 | scsi_host_put(host); | 510 | scsi_host_put(host); |
519 | ecard_release_resources(ec); | 511 | ecard_release_resources(ec); |
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c index cc5d513aa99a..bb2477b3fb0b 100644 --- a/drivers/scsi/arm/eesox.c +++ b/drivers/scsi/arm/eesox.c | |||
@@ -519,7 +519,6 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
519 | { | 519 | { |
520 | struct Scsi_Host *host; | 520 | struct Scsi_Host *host; |
521 | struct eesoxscsi_info *info; | 521 | struct eesoxscsi_info *info; |
522 | unsigned long resbase, reslen; | ||
523 | void __iomem *base; | 522 | void __iomem *base; |
524 | int ret; | 523 | int ret; |
525 | 524 | ||
@@ -527,9 +526,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
527 | if (ret) | 526 | if (ret) |
528 | goto out; | 527 | goto out; |
529 | 528 | ||
530 | resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); | 529 | base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); |
531 | reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); | ||
532 | base = ioremap(resbase, reslen); | ||
533 | if (!base) { | 530 | if (!base) { |
534 | ret = -ENOMEM; | 531 | ret = -ENOMEM; |
535 | goto out_region; | 532 | goto out_region; |
@@ -539,7 +536,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
539 | sizeof(struct eesoxscsi_info)); | 536 | sizeof(struct eesoxscsi_info)); |
540 | if (!host) { | 537 | if (!host) { |
541 | ret = -ENOMEM; | 538 | ret = -ENOMEM; |
542 | goto out_unmap; | 539 | goto out_region; |
543 | } | 540 | } |
544 | 541 | ||
545 | ecard_set_drvdata(ec, host); | 542 | ecard_set_drvdata(ec, host); |
@@ -612,9 +609,6 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
612 | device_remove_file(&ec->dev, &dev_attr_bus_term); | 609 | device_remove_file(&ec->dev, &dev_attr_bus_term); |
613 | scsi_host_put(host); | 610 | scsi_host_put(host); |
614 | 611 | ||
615 | out_unmap: | ||
616 | iounmap(base); | ||
617 | |||
618 | out_region: | 612 | out_region: |
619 | ecard_release_resources(ec); | 613 | ecard_release_resources(ec); |
620 | 614 | ||
@@ -636,8 +630,6 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec) | |||
636 | 630 | ||
637 | device_remove_file(&ec->dev, &dev_attr_bus_term); | 631 | device_remove_file(&ec->dev, &dev_attr_bus_term); |
638 | 632 | ||
639 | iounmap(info->base); | ||
640 | |||
641 | fas216_release(host); | 633 | fas216_release(host); |
642 | scsi_host_put(host); | 634 | scsi_host_put(host); |
643 | ecard_release_resources(ec); | 635 | ecard_release_resources(ec); |
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c index 3cbd525b58c5..d9a546d1917c 100644 --- a/drivers/scsi/arm/powertec.c +++ b/drivers/scsi/arm/powertec.c | |||
@@ -313,7 +313,6 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
313 | { | 313 | { |
314 | struct Scsi_Host *host; | 314 | struct Scsi_Host *host; |
315 | struct powertec_info *info; | 315 | struct powertec_info *info; |
316 | unsigned long resbase, reslen; | ||
317 | void __iomem *base; | 316 | void __iomem *base; |
318 | int ret; | 317 | int ret; |
319 | 318 | ||
@@ -321,9 +320,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
321 | if (ret) | 320 | if (ret) |
322 | goto out; | 321 | goto out; |
323 | 322 | ||
324 | resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); | 323 | base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); |
325 | reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); | ||
326 | base = ioremap(resbase, reslen); | ||
327 | if (!base) { | 324 | if (!base) { |
328 | ret = -ENOMEM; | 325 | ret = -ENOMEM; |
329 | goto out_region; | 326 | goto out_region; |
@@ -333,7 +330,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
333 | sizeof (struct powertec_info)); | 330 | sizeof (struct powertec_info)); |
334 | if (!host) { | 331 | if (!host) { |
335 | ret = -ENOMEM; | 332 | ret = -ENOMEM; |
336 | goto out_unmap; | 333 | goto out_region; |
337 | } | 334 | } |
338 | 335 | ||
339 | ecard_set_drvdata(ec, host); | 336 | ecard_set_drvdata(ec, host); |
@@ -404,9 +401,6 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
404 | device_remove_file(&ec->dev, &dev_attr_bus_term); | 401 | device_remove_file(&ec->dev, &dev_attr_bus_term); |
405 | scsi_host_put(host); | 402 | scsi_host_put(host); |
406 | 403 | ||
407 | out_unmap: | ||
408 | iounmap(base); | ||
409 | |||
410 | out_region: | 404 | out_region: |
411 | ecard_release_resources(ec); | 405 | ecard_release_resources(ec); |
412 | 406 | ||
@@ -428,8 +422,6 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec) | |||
428 | free_dma(info->info.scsi.dma); | 422 | free_dma(info->info.scsi.dma); |
429 | free_irq(ec->irq, info); | 423 | free_irq(ec->irq, info); |
430 | 424 | ||
431 | iounmap(info->base); | ||
432 | |||
433 | fas216_release(host); | 425 | fas216_release(host); |
434 | scsi_host_put(host); | 426 | scsi_host_put(host); |
435 | ecard_release_resources(ec); | 427 | ecard_release_resources(ec); |