Skip to content

Commit

Permalink
net: r6040: Use logical or for MDIO operations
Browse files Browse the repository at this point in the history
This is not a functional change, but we should be using a logical or to
assign the bits we will be writing to the MDIO read and write registers.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed May 24, 2021
1 parent 0056982 commit 190e6e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/rdc/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)
int limit = MAC_DEF_TIMEOUT;
u16 cmd;

iowrite16(MDIO_READ + reg + (phy_addr << 8), ioaddr + MMDIO);
iowrite16(MDIO_READ | reg | (phy_addr << 8), ioaddr + MMDIO);
/* Wait for the read bit to be cleared */
while (limit--) {
cmd = ioread16(ioaddr + MMDIO);
Expand All @@ -224,7 +224,7 @@ static int r6040_phy_write(void __iomem *ioaddr,

iowrite16(val, ioaddr + MMWD);
/* Write the command to the MDIO bus */
iowrite16(MDIO_WRITE + reg + (phy_addr << 8), ioaddr + MMDIO);
iowrite16(MDIO_WRITE | reg | (phy_addr << 8), ioaddr + MMDIO);
/* Wait for the write bit to be cleared */
while (limit--) {
cmd = ioread16(ioaddr + MMDIO);
Expand Down

0 comments on commit 190e6e2

Please sign in to comment.