diff options
author | Michael Walle <michael@walle.cc> | 2022-03-18 21:13:23 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-21 22:33:01 -0700 |
commit | 58ebdba3d851d03b40f181515c761810f3514303 (patch) | |
tree | 436d3ec2160f15cb2c6d569234697f1c474c372a /drivers/net | |
parent | a2e4b5adfdf85d4a94af8a7a9f44e3ee254fd77e (diff) |
net: mdio: mscc-miim: replace magic numbers for the bus reset
Replace the magic numbers by macros which are already defined. It seems
the original commit missed to use them.
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/mdio/mdio-mscc-miim.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index 64fb76c1e395..2f77bf75288d 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -158,18 +158,18 @@ static int mscc_miim_reset(struct mii_bus *bus) { struct mscc_miim_dev *miim = bus->priv; int offset = miim->phy_reset_offset; + int reset_bits = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET | + PHY_CFG_PHY_RESET; int ret; if (miim->phy_regs) { - ret = regmap_write(miim->phy_regs, - MSCC_PHY_REG_PHY_CFG + offset, 0); + ret = regmap_write(miim->phy_regs, offset, 0); if (ret < 0) { WARN_ONCE(1, "mscc reset set error %d\n", ret); return ret; } - ret = regmap_write(miim->phy_regs, - MSCC_PHY_REG_PHY_CFG + offset, 0x1ff); + ret = regmap_write(miim->phy_regs, offset, reset_bits); if (ret < 0) { WARN_ONCE(1, "mscc reset clear error %d\n", ret); return ret; @@ -272,7 +272,7 @@ static int mscc_miim_probe(struct platform_device *pdev) miim = bus->priv; miim->phy_regs = phy_regmap; - miim->phy_reset_offset = 0; + miim->phy_reset_offset = MSCC_PHY_REG_PHY_CFG; ret = of_mdiobus_register(bus, pdev->dev.of_node); if (ret < 0) { |