diff options
author | kernel test robot <lkp@intel.com> | 2020-07-10 00:06:18 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-09 13:09:51 -0700 |
commit | faea30ed717d78e890f3fc0d96ceb6aba2baa4c4 (patch) | |
tree | 6b0c81d364a485f86844f7f3680f4f7b4ff8f8d8 /drivers/net/phy | |
parent | e3cbdaf146159d2e708e51d168fd5fab793f766b (diff) |
net: phy: mscc: fix ptr_ret.cocci warnings
drivers/net/phy/mscc/mscc_ptp.c:1496:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Fixes: 7d272e63e097 ("net: phy: mscc: timestamping and PHC support")
CC: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mscc/mscc_ptp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/phy/mscc/mscc_ptp.c b/drivers/net/phy/mscc/mscc_ptp.c index ef3441747348..b97ee79f3cdf 100644 --- a/drivers/net/phy/mscc/mscc_ptp.c +++ b/drivers/net/phy/mscc/mscc_ptp.c @@ -1494,10 +1494,7 @@ static int __vsc8584_init_ptp(struct phy_device *phydev) vsc8531->ptp->ptp_clock = ptp_clock_register(&vsc8531->ptp->caps, &phydev->mdio.dev); - if (IS_ERR(vsc8531->ptp->ptp_clock)) - return PTR_ERR(vsc8531->ptp->ptp_clock); - - return 0; + return PTR_ERR_OR_ZERO(vsc8531->ptp->ptp_clock); } void vsc8584_config_ts_intr(struct phy_device *phydev) |