[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>
This commit is contained in:
committed by
Russell King
parent
c7b87f3d50
commit
10bdaaa0fa
@ -281,7 +281,6 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||
{
|
||||
struct Scsi_Host *host;
|
||||
struct arxescsi_info *info;
|
||||
unsigned long resbase, reslen;
|
||||
void __iomem *base;
|
||||
int ret;
|
||||
|
||||
@ -289,9 +288,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
resbase = ecard_resource_start(ec, ECARD_RES_MEMC);
|
||||
reslen = ecard_resource_len(ec, ECARD_RES_MEMC);
|
||||
base = ioremap(resbase, reslen);
|
||||
base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
|
||||
if (!base) {
|
||||
ret = -ENOMEM;
|
||||
goto out_region;
|
||||
@ -300,7 +297,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||
host = scsi_host_alloc(&arxescsi_template, sizeof(struct arxescsi_info));
|
||||
if (!host) {
|
||||
ret = -ENOMEM;
|
||||
goto out_unmap;
|
||||
goto out_region;
|
||||
}
|
||||
|
||||
info = (struct arxescsi_info *)host->hostdata;
|
||||
@ -337,8 +334,6 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||
fas216_release(host);
|
||||
out_unregister:
|
||||
scsi_host_put(host);
|
||||
out_unmap:
|
||||
iounmap(base);
|
||||
out_region:
|
||||
ecard_release_resources(ec);
|
||||
out:
|
||||
@ -348,13 +343,10 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||
static void __devexit arxescsi_remove(struct expansion_card *ec)
|
||||
{
|
||||
struct Scsi_Host *host = ecard_get_drvdata(ec);
|
||||
struct arxescsi_info *info = (struct arxescsi_info *)host->hostdata;
|
||||
|
||||
ecard_set_drvdata(ec, NULL);
|
||||
fas216_remove(host);
|
||||
|
||||
iounmap(info->base);
|
||||
|
||||
fas216_release(host);
|
||||
scsi_host_put(host);
|
||||
ecard_release_resources(ec);
|
||||
|
Reference in New Issue
Block a user