diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2015-12-08 00:41:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-08 21:55:05 -0500 |
commit | 78fa3c5c52e63281415b73ee83a05ee4194498b1 (patch) | |
tree | fe2b6da2ba96e4c055275999b3cddee50ac9caa7 /drivers/net/ethernet/renesas/sh_eth.c | |
parent | 39b4b06b8b20ae011373bae5f9552cce17c47f64 (diff) | |
download | op-kernel-dev-78fa3c5c52e63281415b73ee83a05ee4194498b1.zip op-kernel-dev-78fa3c5c52e63281415b73ee83a05ee4194498b1.tar.gz |
sh_eth: get rid of bb_{set|clr|read}()
After the MDIO bitbang code consolidation, there's no need anymore for
bb_{set|clr}() as well as bb_read() -- just expand them inline, thus
saving more LoCs...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas/sh_eth.c')
-rw-r--r-- | drivers/net/ethernet/renesas/sh_eth.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index f0c7108..67cd243 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1015,35 +1015,20 @@ struct bb_info { void *addr; }; -/* PHY bit set */ -static void bb_set(void *addr, u32 msk) -{ - iowrite32(ioread32(addr) | msk, addr); -} - -/* PHY bit clear */ -static void bb_clr(void *addr, u32 msk) -{ - iowrite32((ioread32(addr) & ~msk), addr); -} - -/* PHY bit read */ -static int bb_read(void *addr, u32 msk) -{ - return (ioread32(addr) & msk) != 0; -} - static void sh_mdio_ctrl(struct mdiobb_ctrl *ctrl, u32 mask, int set) { struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); + u32 pir; if (bitbang->set_gate) bitbang->set_gate(bitbang->addr); + pir = ioread32(bitbang->addr); if (set) - bb_set(bitbang->addr, mask); + pir |= mask; else - bb_clr(bitbang->addr, mask); + pir &= ~mask; + iowrite32(pir, bitbang->addr); } /* Data I/O pin control */ @@ -1066,7 +1051,7 @@ static int sh_get_mdio(struct mdiobb_ctrl *ctrl) if (bitbang->set_gate) bitbang->set_gate(bitbang->addr); - return bb_read(bitbang->addr, PIR_MDI); + return (ioread32(bitbang->addr) & PIR_MDI) != 0; } /* MDC pin control */ |