[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimJM0yEOU6RgoAs+Njv5b7ixVRnPubnUg=F72GX@mail.gmail.com>
Date: Thu, 17 Feb 2011 09:24:39 +0900
From: Nobuhiro Iwamatsu <iwamatsu@...auri.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
Cc: netdev@...r.kernel.org, SH-Linux <linux-sh@...r.kernel.org>
Subject: Re: [RFC, PATCH 2/4] net: sh_eth: remove the SH_TSU_ADDR
2011/2/15 Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>:
> The defination is hardcoded in this driver for some CPUs. This patch
> modifies to get resource of TSU address from platform_device.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> ---
> drivers/net/sh_eth.c | 16 ++++++++++++----
> drivers/net/sh_eth.h | 15 ---------------
> 2 files changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
> index 3b6d545..0593f29 100644
> --- a/drivers/net/sh_eth.c
> +++ b/drivers/net/sh_eth.c
> @@ -1446,7 +1446,7 @@ static const struct net_device_ops sh_eth_netdev_ops = {
> static int sh_eth_drv_probe(struct platform_device *pdev)
> {
> int ret, devno = 0;
> - struct resource *res;
> + struct resource *res, *res_tsu;
> struct net_device *ndev = NULL;
> struct sh_eth_private *mdp;
> struct sh_eth_plat_data *pd;
> @@ -1520,9 +1520,13 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> mdp->cd->chip_reset(ndev);
>
> #if defined(SH_ETH_HAS_TSU)
> - /* TSU init (Init only)*/
> - mdp->tsu_addr = SH_TSU_ADDR;
> - sh_eth_tsu_init(mdp);
> + res_tsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (res_tsu) {
> + mdp->tsu_addr = ioremap(res_tsu->start,
> + resource_size(res_tsu));
> + /* TSU init (Init only)*/
> + sh_eth_tsu_init(mdp);
> + }
> #endif
> }
>
> @@ -1549,6 +1553,8 @@ out_unregister:
>
> out_release:
> /* net_dev free */
> + if (mdp->tsu_addr)
> + iounmap(mdp->tsu_addr);
> if (ndev)
> free_netdev(ndev);
>
> @@ -1559,7 +1565,9 @@ out:
> static int sh_eth_drv_remove(struct platform_device *pdev)
> {
> struct net_device *ndev = platform_get_drvdata(pdev);
> + struct sh_eth_private *mdp = netdev_priv(ndev);
>
> + iounmap(mdp->tsu_addr);
> sh_mdio_release(ndev);
> unregister_netdev(ndev);
> pm_runtime_disable(&pdev->dev);
You forget to fix for ARSTR.
Best regards,
Nobuhiro
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists