From: Fabio Estevam <festevam@gmail.com>
To: davem@davemloft.net
Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check
Date: Mon, 17 Jul 2017 18:09:09 -0300 [thread overview]
Message-ID: <1500325749-8382-1-git-send-email-festevam@gmail.com> (raw)
From: Fabio Estevam <fabio.estevam@nxp.com>
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>
---
drivers/net/phy/mdio_bus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 2df7b62c..b6f9fa6 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -399,8 +399,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
}
/* 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);
}
--
2.7.4
next reply other threads:[~2017-07-17 21:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 21:09 Fabio Estevam [this message]
2017-07-17 21:21 ` [PATCH net-next] mdio_bus: Remove unneeded gpiod NULL check Andrew Lunn
2017-07-17 23:57 ` David Miller
2017-07-18 9:56 ` Sergei Shtylyov
2017-07-18 12:39 ` Fabio Estevam
2017-07-18 12:48 ` Sergei Shtylyov
2017-07-18 12:52 ` Fabio Estevam
2017-07-18 13:02 ` Sergei Shtylyov
2017-07-18 13:09 ` Fabio Estevam
2017-07-18 13:13 ` Sergei Shtylyov
2017-07-18 13:32 ` Andrew Lunn
2017-07-19 22:37 ` Fabio Estevam
2017-08-02 11:57 ` Linus Walleij
2017-09-07 21:30 ` Woojung.Huh
2017-09-07 21:33 ` Linus Walleij
2017-09-07 21:39 ` Florian Fainelli
2017-09-07 21:51 ` Woojung.Huh
2017-09-08 19:56 ` Florian Fainelli
2017-09-08 20:03 ` Woojung.Huh
2017-09-08 23:17 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1500325749-8382-1-git-send-email-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=fabio.estevam@nxp.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).