diff options
author | 2020-04-22 16:15:42 +0800 | |
---|---|---|
committer | 2020-04-22 19:40:07 -0700 | |
commit | d0f0c55e7c4ca7c66877064d7c1f4795025e88f8 (patch) | |
tree | 1817c2b0ef6d0ee5e6743b3fafae3c3c3f52fc0c | |
parent | net: phy: micrel: add phy-mode support for the KSZ9031 PHY (diff) | |
download | linux-dev-d0f0c55e7c4ca7c66877064d7c1f4795025e88f8.tar.xz linux-dev-d0f0c55e7c4ca7c66877064d7c1f4795025e88f8.zip |
net: phy: Use IS_ERR() to check and simplify code
Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_OR_ZERO()
to simplify code, avoid redundant paramenter definitions
and judgements.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/mdio_bus.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 26b00af94573..3e79b96fa344 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -42,14 +42,11 @@ static int mdiobus_register_gpiod(struct mdio_device *mdiodev) { - int error; - /* Deassert the optional reset signal */ mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev, "reset", GPIOD_OUT_LOW); - error = PTR_ERR_OR_ZERO(mdiodev->reset_gpio); - if (error) - return error; + if (IS_ERR(mdiodev->reset_gpio)) + return PTR_ERR(mdiodev->reset_gpio); if (mdiodev->reset_gpio) gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset"); |