Skip to content

Commit

Permalink
sh_eth: get rid of the 2nd parameter to sh_eth_dev_init()
Browse files Browse the repository at this point in the history
sh_eth_dev_init()  is now always called with  'true' as the  2nd argument,
so that there's no more sense in having 2 parameters to this function...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Apr 26, 2016
1 parent f052f20 commit f796721
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ static int sh_eth_ring_init(struct net_device *ndev)
return -ENOMEM;
}

static int sh_eth_dev_init(struct net_device *ndev, bool start)
static int sh_eth_dev_init(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
int ret;
Expand Down Expand Up @@ -1279,10 +1279,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
RFLR);

sh_eth_modify(ndev, EESR, 0, 0);
if (start) {
mdp->irq_enabled = true;
sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);
}
mdp->irq_enabled = true;
sh_eth_write(ndev, mdp->cd->eesipr_value, EESIPR);

/* PAUSE Prohibition */
sh_eth_write(ndev, ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) |
Expand All @@ -1295,8 +1293,7 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
sh_eth_write(ndev, mdp->cd->ecsr_value, ECSR);

/* E-MAC Interrupt Enable register */
if (start)
sh_eth_write(ndev, mdp->cd->ecsipr_value, ECSIPR);
sh_eth_write(ndev, mdp->cd->ecsipr_value, ECSIPR);

/* Set MAC address */
update_mac_address(ndev);
Expand All @@ -1309,10 +1306,8 @@ static int sh_eth_dev_init(struct net_device *ndev, bool start)
if (mdp->cd->tpauser)
sh_eth_write(ndev, TPAUSER_UNLIMITED, TPAUSER);

if (start) {
/* Setting the Rx mode will start the Rx process. */
sh_eth_write(ndev, EDRRR_R, EDRRR);
}
/* Setting the Rx mode will start the Rx process. */
sh_eth_write(ndev, EDRRR_R, EDRRR);

return ret;
}
Expand Down Expand Up @@ -2194,7 +2189,7 @@ static int sh_eth_set_ringparam(struct net_device *ndev,
__func__);
return ret;
}
ret = sh_eth_dev_init(ndev, true);
ret = sh_eth_dev_init(ndev);
if (ret < 0) {
netdev_err(ndev, "%s: sh_eth_dev_init failed.\n",
__func__);
Expand Down Expand Up @@ -2246,7 +2241,7 @@ static int sh_eth_open(struct net_device *ndev)
goto out_free_irq;

/* device init */
ret = sh_eth_dev_init(ndev, true);
ret = sh_eth_dev_init(ndev);
if (ret)
goto out_free_irq;

Expand Down Expand Up @@ -2299,7 +2294,7 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
}

/* device init */
sh_eth_dev_init(ndev, true);
sh_eth_dev_init(ndev);

netif_start_queue(ndev);
}
Expand Down

0 comments on commit f796721

Please sign in to comment.