summaryrefslogtreecommitdiff
path: root/drivers/net/mdio
diff options
context:
space:
mode:
authorCalvin Johnson <calvin.johnson@oss.nxp.com>2021-06-11 13:53:53 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-11 13:08:52 -0700
commitb9926da003cab58594803a2bc5a1d5bd7c670eba (patch)
tree306f614f582f2e98e9062a7d1070a7525c118b26 /drivers/net/mdio
parentcf99686072a1b7037a1d782b66037b2b722bf2c9 (diff)
net: mii_timestamper: check NULL in unregister_mii_timestamper()
Callers of unregister_mii_timestamper() currently check for NULL value of mii_ts before calling it. Place the NULL check inside unregister_mii_timestamper() and update the callers accordingly. Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Grant Likely <grant.likely@arm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mdio')
-rw-r--r--drivers/net/mdio/of_mdio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 29f121cba314..d73c0570f19c 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -115,15 +115,13 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio,
else
phy = get_phy_device(mdio, addr, is_c45);
if (IS_ERR(phy)) {
- if (mii_ts)
- unregister_mii_timestamper(mii_ts);
+ unregister_mii_timestamper(mii_ts);
return PTR_ERR(phy);
}
rc = of_mdiobus_phy_device_register(mdio, phy, child, addr);
if (rc) {
- if (mii_ts)
- unregister_mii_timestamper(mii_ts);
+ unregister_mii_timestamper(mii_ts);
phy_device_free(phy);
return rc;
}