From 10bdaaa0fad620145cf10e2b573266b2d80b44de Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 10 May 2007 18:40:51 +0100 Subject: [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 --- drivers/net/arm/ether1.c | 6 +----- drivers/net/arm/ether3.c | 6 +----- drivers/net/arm/etherh.c | 13 ++----------- 3 files changed, 4 insertions(+), 21 deletions(-) (limited to 'drivers/net/arm') diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c index f075cebe84a..f21148e7b57 100644 --- a/drivers/net/arm/ether1.c +++ b/drivers/net/arm/ether1.c @@ -1014,8 +1014,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) SET_NETDEV_DEV(dev, &ec->dev); dev->irq = ec->irq; - priv(dev)->base = ioremap(ecard_resource_start(ec, ECARD_RES_IOCFAST), - ecard_resource_len(ec, ECARD_RES_IOCFAST)); + priv(dev)->base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); if (!priv(dev)->base) { ret = -ENOMEM; goto free; @@ -1056,8 +1055,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) return 0; free: - if (priv(dev)->base) - iounmap(priv(dev)->base); free_netdev(dev); release: ecard_release_resources(ec); @@ -1072,7 +1069,6 @@ static void __devexit ether1_remove(struct expansion_card *ec) ecard_set_drvdata(ec, NULL); unregister_netdev(dev); - iounmap(priv(dev)->base); free_netdev(dev); ecard_release_resources(ec); } diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c index 32da2eb9bce..da713500654 100644 --- a/drivers/net/arm/ether3.c +++ b/drivers/net/arm/ether3.c @@ -793,8 +793,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &ec->dev); - priv(dev)->base = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), - ecard_resource_len(ec, ECARD_RES_MEMC)); + priv(dev)->base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0); if (!priv(dev)->base) { ret = -ENOMEM; goto free; @@ -869,8 +868,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) return 0; free: - if (priv(dev)->base) - iounmap(priv(dev)->base); free_netdev(dev); release: ecard_release_resources(ec); @@ -885,7 +882,6 @@ static void __devexit ether3_remove(struct expansion_card *ec) ecard_set_drvdata(ec, NULL); unregister_netdev(dev); - iounmap(priv(dev)->base); free_netdev(dev); ecard_release_resources(ec); } diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 387f1e3a4e8..769ba69451f 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c @@ -686,7 +686,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) eh->supported = data->supported; eh->ctrl = 0; eh->id = ec->cid.product; - eh->memc = ioremap(ecard_resource_start(ec, ECARD_RES_MEMC), PAGE_SIZE); + eh->memc = ecardm_iomap(ec, ECARD_RES_MEMC, 0, PAGE_SIZE); if (!eh->memc) { ret = -ENOMEM; goto free; @@ -694,7 +694,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) eh->ctrl_port = eh->memc; if (data->ctrl_ioc) { - eh->ioc_fast = ioremap(ecard_resource_start(ec, ECARD_RES_IOCFAST), PAGE_SIZE); + eh->ioc_fast = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, PAGE_SIZE); if (!eh->ioc_fast) { ret = -ENOMEM; goto free; @@ -758,10 +758,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) return 0; free: - if (eh->ioc_fast) - iounmap(eh->ioc_fast); - if (eh->memc) - iounmap(eh->memc); free_netdev(dev); release: ecard_release_resources(ec); @@ -772,16 +768,11 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) static void __devexit etherh_remove(struct expansion_card *ec) { struct net_device *dev = ecard_get_drvdata(ec); - struct etherh_priv *eh = etherh_priv(dev); ecard_set_drvdata(ec, NULL); unregister_netdev(dev); - if (eh->ioc_fast) - iounmap(eh->ioc_fast); - iounmap(eh->memc); - free_netdev(dev); ecard_release_resources(ec); -- cgit v1.2.3-18-g5258