Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1425570
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 net-next v3 06/14] net: dsa: mv88e6xxx: use gpio get optional variant |
| Date | 2016-06-18 02:20 +0200 |
| Message-ID | <rLc9r-57u-19@gated-at.bofh.it> (permalink) |
| References | <rLbZM-54e-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use the optional variant to get the reset GPIO line, instead of checking
for the -ENOENT error.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
drivers/net/dsa/mv88e6xxx.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c
index ad7735d..ec28465 100644
--- a/drivers/net/dsa/mv88e6xxx.c
+++ b/drivers/net/dsa/mv88e6xxx.c
@@ -3744,16 +3744,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
if (!ps->info)
return -ENODEV;
- ps->reset = devm_gpiod_get(dev, "reset", GPIOD_ASIS);
- if (IS_ERR(ps->reset)) {
- err = PTR_ERR(ps->reset);
- if (err == -ENOENT) {
- /* Optional, so not an error */
- ps->reset = NULL;
- } else {
- return err;
- }
- }
+ ps->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS);
+ if (IS_ERR(ps->reset))
+ return PTR_ERR(ps->reset);
if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM) &&
!of_property_read_u32(np, "eeprom-length", &eeprom_len))
--
2.8.3
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v3 net-next v3 06/14] net: dsa: mv88e6xxx: use gpio get optional variant Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-06-18 02:20 +0200 Re: [PATCH v3 net-next v3 06/14] net: dsa: mv88e6xxx: use gpio get optional variant Andrew Lunn <andrew@lunn.ch> - 2016-06-18 22:20 +0200
csiph-web