diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-14 22:10:41 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-17 22:10:42 +0300 |
commit | 1dbba4cb8df73844ea0d7c1fd11e1ea35f1670b7 (patch) | |
tree | 400030a932de59b62b9ab16b8969e0c0b89e9371 /drivers/net/phy/phy-core.c | |
parent | 450cc8cce23d0db11b19fa89973ddb6d5edd010c (diff) | |
download | linux-1dbba4cb8df73844ea0d7c1fd11e1ea35f1670b7.tar.xz |
net: phy: test the right variable in phy_write_mmd()
This is a copy and paste buglet. We meant to test for ->write_mmd but
we test for ->read_mmd.
Fixes: 1ee6b9bc6206 ("net: phy: make phy_(read|write)_mmd() generic MMD accessors")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy-core.c')
-rw-r--r-- | drivers/net/phy/phy-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 357a4d0d7641..6739b738bbaf 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -76,7 +76,7 @@ int phy_write_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val) if (regnum > (u16)~0 || devad > 32) return -EINVAL; - if (phydev->drv->read_mmd) { + if (phydev->drv->write_mmd) { ret = phydev->drv->write_mmd(phydev, devad, regnum, val); } else if (phydev->is_c45) { u32 addr = MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff); |