Commit 78fa3c5c authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller

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: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39b4b06b
...@@ -1015,35 +1015,20 @@ struct bb_info { ...@@ -1015,35 +1015,20 @@ struct bb_info {
void *addr; 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) static void sh_mdio_ctrl(struct mdiobb_ctrl *ctrl, u32 mask, int set)
{ {
struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl);
u32 pir;
if (bitbang->set_gate) if (bitbang->set_gate)
bitbang->set_gate(bitbang->addr); bitbang->set_gate(bitbang->addr);
pir = ioread32(bitbang->addr);
if (set) if (set)
bb_set(bitbang->addr, mask); pir |= mask;
else else
bb_clr(bitbang->addr, mask); pir &= ~mask;
iowrite32(pir, bitbang->addr);
} }
/* Data I/O pin control */ /* Data I/O pin control */
...@@ -1066,7 +1051,7 @@ static int sh_get_mdio(struct mdiobb_ctrl *ctrl) ...@@ -1066,7 +1051,7 @@ static int sh_get_mdio(struct mdiobb_ctrl *ctrl)
if (bitbang->set_gate) if (bitbang->set_gate)
bitbang->set_gate(bitbang->addr); bitbang->set_gate(bitbang->addr);
return bb_read(bitbang->addr, PIR_MDI); return (ioread32(bitbang->addr) & PIR_MDI) != 0;
} }
/* MDC pin control */ /* MDC pin control */
......
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