aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 5a5afbc7273b..8bd0e5897424 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1859,18 +1859,20 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
1859 /* read and set MAC address */ 1859 /* read and set MAC address */
1860 read_mac_address(ndev, pd->mac_addr); 1860 read_mac_address(ndev, pd->mac_addr);
1861 1861
1862 /* ioremap the TSU registers */
1863 if (mdp->cd->tsu) {
1864 struct resource *rtsu;
1865 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1866 if (!rtsu) {
1867 dev_err(&pdev->dev, "Not found TSU resource\n");
1868 goto out_release;
1869 }
1870 mdp->tsu_addr = ioremap(rtsu->start,
1871 resource_size(rtsu));
1872 }
1873
1862 /* initialize first or needed device */ 1874 /* initialize first or needed device */
1863 if (!devno || pd->needs_init) { 1875 if (!devno || pd->needs_init) {
1864 if (mdp->cd->tsu) {
1865 struct resource *rtsu;
1866 rtsu = platform_get_resource(pdev, IORESOURCE_MEM, 1);
1867 if (!rtsu) {
1868 dev_err(&pdev->dev, "Not found TSU resource\n");
1869 goto out_release;
1870 }
1871 mdp->tsu_addr = ioremap(rtsu->start,
1872 resource_size(rtsu));
1873 }
1874 if (mdp->cd->chip_reset) 1876 if (mdp->cd->chip_reset)
1875 mdp->cd->chip_reset(ndev); 1877 mdp->cd->chip_reset(ndev);
1876 1878
@@ -1919,7 +1921,8 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
1919 struct net_device *ndev = platform_get_drvdata(pdev); 1921 struct net_device *ndev = platform_get_drvdata(pdev);
1920 struct sh_eth_private *mdp = netdev_priv(ndev); 1922 struct sh_eth_private *mdp = netdev_priv(ndev);
1921 1923
1922 iounmap(mdp->tsu_addr); 1924 if (mdp->cd->tsu)
1925 iounmap(mdp->tsu_addr);
1923 sh_mdio_release(ndev); 1926 sh_mdio_release(ndev);
1924 unregister_netdev(ndev); 1927 unregister_netdev(ndev);
1925 pm_runtime_disable(&pdev->dev); 1928 pm_runtime_disable(&pdev->dev);