Commit 6ba88021 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by David S. Miller

net: sh_eth: modify a condition of ioremap for TSU

If the controller has TSU, the each channel needs TSU registers.
This patch also fixes the iounmap condition in the sh_eth_drv_remove().
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 150647fb
...@@ -1859,8 +1859,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -1859,8 +1859,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
/* read and set MAC address */ /* read and set MAC address */
read_mac_address(ndev, pd->mac_addr); read_mac_address(ndev, pd->mac_addr);
/* initialize first or needed device */ /* ioremap the TSU registers */
if (!devno || pd->needs_init) {
if (mdp->cd->tsu) { if (mdp->cd->tsu) {
struct resource *rtsu; struct resource *rtsu;
rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1); rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
...@@ -1871,6 +1870,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -1871,6 +1870,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
mdp->tsu_addr = ioremap(rtsu->start, mdp->tsu_addr = ioremap(rtsu->start,
resource_size(rtsu)); resource_size(rtsu));
} }
/* initialize first or needed device */
if (!devno || pd->needs_init) {
if (mdp->cd->chip_reset) if (mdp->cd->chip_reset)
mdp->cd->chip_reset(ndev); mdp->cd->chip_reset(ndev);
...@@ -1919,6 +1921,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev) ...@@ -1919,6 +1921,7 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
struct net_device *ndev = platform_get_drvdata(pdev); struct net_device *ndev = platform_get_drvdata(pdev);
struct sh_eth_private *mdp = netdev_priv(ndev); struct sh_eth_private *mdp = netdev_priv(ndev);
if (mdp->cd->tsu)
iounmap(mdp->tsu_addr); iounmap(mdp->tsu_addr);
sh_mdio_release(ndev); sh_mdio_release(ndev);
unregister_netdev(ndev); unregister_netdev(ndev);
......
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