mdio_bus: Remove unneeded gpiod NULL check
authorFabio Estevam <fabio.estevam@nxp.com>
Mon, 17 Jul 2017 21:09:09 +0000 (18:09 -0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jul 2017 23:57:04 +0000 (16:57 -0700)
The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio_bus.c

index 2df7b62c1a36811e97087ae641a89d06641cef4e..b6f9fa67016831745c5ad43dfe466605182daf71 100644 (file)
@@ -399,8 +399,7 @@ error:
        }
 
        /* Put PHYs in RESET to save power */
-       if (bus->reset_gpiod)
-               gpiod_set_value_cansleep(bus->reset_gpiod, 1);
+       gpiod_set_value_cansleep(bus->reset_gpiod, 1);
 
        device_del(&bus->dev);
        return err;
@@ -425,8 +424,7 @@ void mdiobus_unregister(struct mii_bus *bus)
        }
 
        /* Put PHYs in RESET to save power */
-       if (bus->reset_gpiod)
-               gpiod_set_value_cansleep(bus->reset_gpiod, 1);
+       gpiod_set_value_cansleep(bus->reset_gpiod, 1);
 
        device_del(&bus->dev);
 }