diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2018-07-23 21:14:38 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-23 12:34:50 -0700 |
commit | 7a54c867bad601406d71f375362048d8ccfb5fae (patch) | |
tree | 3c3d82f98274d7697baf112a0534a7bc4a8074a1 /drivers/net/ethernet/renesas | |
parent | ecbecb0a90fbc318163dd1747bd325e08aee4b12 (diff) | |
download | linux-7a54c867bad601406d71f375362048d8ccfb5fae.tar.bz2 |
sh_eth: make sh_eth_tsu_write_entry() take 'offset' parameter
We can add the TSU register base address to a TSU register offset right
in sh_eth_tsu_write_entry(), no need to do it in its callers...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index bf002c2b5d79..b3434109e5e1 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -2676,18 +2676,19 @@ static int sh_eth_tsu_busy(struct net_device *ndev) return 0; } -static int sh_eth_tsu_write_entry(struct net_device *ndev, void *reg, +static int sh_eth_tsu_write_entry(struct net_device *ndev, u16 offset, const u8 *addr) { + struct sh_eth_private *mdp = netdev_priv(ndev); u32 val; val = addr[0] << 24 | addr[1] << 16 | addr[2] << 8 | addr[3]; - iowrite32(val, reg); + iowrite32(val, mdp->tsu_addr + offset); if (sh_eth_tsu_busy(ndev) < 0) return -EBUSY; val = addr[4] << 8 | addr[5]; - iowrite32(val, reg + 4); + iowrite32(val, mdp->tsu_addr + offset + 4); if (sh_eth_tsu_busy(ndev) < 0) return -EBUSY; @@ -2747,9 +2748,7 @@ static int sh_eth_tsu_disable_cam_entry_table(struct net_device *ndev, ~(1 << (31 - entry)), TSU_TEN); memset(blank, 0, sizeof(blank)); - ret = sh_eth_tsu_write_entry(ndev, - mdp->tsu_addr + reg_offset + entry * 8, - blank); + ret = sh_eth_tsu_write_entry(ndev, reg_offset + entry * 8, blank); if (ret < 0) return ret; return 0; @@ -2770,9 +2769,7 @@ static int sh_eth_tsu_add_entry(struct net_device *ndev, const u8 *addr) i = sh_eth_tsu_find_empty(ndev); if (i < 0) return -ENOMEM; - ret = sh_eth_tsu_write_entry(ndev, - mdp->tsu_addr + reg_offset + i * 8, - addr); + ret = sh_eth_tsu_write_entry(ndev, reg_offset + i * 8, addr); if (ret < 0) return ret; |