Commit 3fb07877 authored by Russell King's avatar Russell King

[ARM] Fix Acorn SCSI drivers to use ecard_{request,release}_resources

parent 5fdc4ecc
...@@ -286,14 +286,12 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -286,14 +286,12 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
unsigned char *base; unsigned char *base;
int ret; int ret;
resbase = ecard_resource_start(ec, ECARD_RES_MEMC); ret = ecard_request_resources(ec);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC); if (ret)
if (!request_mem_region(resbase, reslen, "arxescsi")) {
ret = -EBUSY;
goto out; goto out;
}
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
base = ioremap(resbase, reslen); base = ioremap(resbase, reslen);
if (!base) { if (!base) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -345,7 +343,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -345,7 +343,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
out_unmap: out_unmap:
iounmap(base); iounmap(base);
out_region: out_region:
release_mem_region(resbase, reslen); ecard_release_resources(ec);
out: out:
return ret; return ret;
} }
...@@ -353,20 +351,15 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -353,20 +351,15 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
static void __devexit arxescsi_remove(struct expansion_card *ec) static void __devexit arxescsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
iounmap((void *)host->base); iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
release_mem_region(resbase, reslen);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
ecard_release_resources(ec);
} }
static const struct ecard_id arxescsi_cids[] = { static const struct ecard_id arxescsi_cids[] = {
......
...@@ -408,14 +408,12 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -408,14 +408,12 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
unsigned char *base; unsigned char *base;
int ret; int ret;
resbase = ecard_resource_start(ec, ECARD_RES_MEMC); ret = ecard_request_resources(ec);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC); if (ret)
if (!request_mem_region(resbase, reslen, "cumanascsi2")) {
ret = -EBUSY;
goto out; goto out;
}
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
base = ioremap(resbase, reslen); base = ioremap(resbase, reslen);
if (!base) { if (!base) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -504,7 +502,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -504,7 +502,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
iounmap(base); iounmap(base);
out_region: out_region:
release_mem_region(resbase, reslen); ecard_release_resources(ec);
out: out:
return ret; return ret;
...@@ -514,7 +512,6 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec) ...@@ -514,7 +512,6 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata; struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
...@@ -525,13 +522,9 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec) ...@@ -525,13 +522,9 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec)
iounmap((void *)host->base); iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
release_mem_region(resbase, reslen);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
ecard_release_resources(ec);
} }
static const struct ecard_id cumanascsi2_cids[] = { static const struct ecard_id cumanascsi2_cids[] = {
......
...@@ -525,14 +525,12 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -525,14 +525,12 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
unsigned char *base; unsigned char *base;
int ret; int ret;
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); ret = ecard_request_resources(ec);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); if (ret)
if (!request_mem_region(resbase, reslen, "eesoxscsi")) {
ret = -EBUSY;
goto out; goto out;
}
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
base = ioremap(resbase, reslen); base = ioremap(resbase, reslen);
if (!base) { if (!base) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -622,7 +620,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -622,7 +620,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
iounmap(base); iounmap(base);
out_region: out_region:
release_mem_region(resbase, reslen); ecard_release_resources(ec);
out: out:
return ret; return ret;
...@@ -632,7 +630,6 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec) ...@@ -632,7 +630,6 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata; struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
...@@ -645,13 +642,9 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec) ...@@ -645,13 +642,9 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec)
iounmap((void *)host->base); iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
release_mem_region(resbase, reslen);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
ecard_release_resources(ec);
} }
static const struct ecard_id eesoxscsi_cids[] = { static const struct ecard_id eesoxscsi_cids[] = {
......
...@@ -318,14 +318,12 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -318,14 +318,12 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
unsigned char *base; unsigned char *base;
int ret; int ret;
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST); ret = ecard_request_resources(ec);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST); if (ret)
if (!request_mem_region(resbase, reslen, "powertecscsi")) {
ret = -EBUSY;
goto out; goto out;
}
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
base = ioremap(resbase, reslen); base = ioremap(resbase, reslen);
if (!base) { if (!base) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -413,7 +411,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id) ...@@ -413,7 +411,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
iounmap(base); iounmap(base);
out_region: out_region:
release_mem_region(resbase, reslen); ecard_release_resources(ec);
out: out:
return ret; return ret;
...@@ -423,7 +421,6 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec) ...@@ -423,7 +421,6 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec)
{ {
struct Scsi_Host *host = ecard_get_drvdata(ec); struct Scsi_Host *host = ecard_get_drvdata(ec);
struct powertecscsi_info *info = (struct powertecscsi_info *)host->hostdata; struct powertecscsi_info *info = (struct powertecscsi_info *)host->hostdata;
unsigned long resbase, reslen;
ecard_set_drvdata(ec, NULL); ecard_set_drvdata(ec, NULL);
fas216_remove(host); fas216_remove(host);
...@@ -436,13 +433,9 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec) ...@@ -436,13 +433,9 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec)
iounmap((void *)host->base); iounmap((void *)host->base);
resbase = ecard_resource_start(ec, ECARD_RES_IOCFAST);
reslen = ecard_resource_len(ec, ECARD_RES_IOCFAST);
release_mem_region(resbase, reslen);
fas216_release(host); fas216_release(host);
scsi_host_put(host); scsi_host_put(host);
ecard_release_resources(ec);
} }
static const struct ecard_id powertecscsi_cids[] = { static const struct ecard_id powertecscsi_cids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment