diff options
author | Martin Blumenstingl <martin.blumenstingl@googlemail.com> | 2019-06-15 12:09:28 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-16 13:53:41 -0700 |
commit | 626c5fe423c2bc9b88cc07549626b94bcde05c9f (patch) | |
tree | e0e37d436f3e161b9b70bc0daaabc18ebccc3e73 /drivers | |
parent | a51486266c3ba8e035a47fa96df67f274fe0c7d0 (diff) | |
download | lwn-626c5fe423c2bc9b88cc07549626b94bcde05c9f.tar.gz lwn-626c5fe423c2bc9b88cc07549626b94bcde05c9f.zip |
net: stmmac: drop redundant check in stmmac_mdio_reset
A simplified version of the existing code looks like this:
if (priv->device->of_node) {
struct device_node *np = priv->device->of_node;
if (!np)
return 0;
The second "if" never evaluates to true because the first "if" checks
for exactly the opposite.
Drop the redundant check and early return to make the code easier to
understand.
No functional changes intended.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index f1c39dd048e7..21bbe3ba3e8e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -256,9 +256,6 @@ int stmmac_mdio_reset(struct mii_bus *bus) if (data->reset_gpio < 0) { struct device_node *np = priv->device->of_node; - if (!np) - return 0; - reset_gpio = devm_gpiod_get_optional(priv->device, "snps,reset", GPIOD_OUT_LOW); |