diff options
author | Vivien Didelot <vivien.didelot@savoirfairelinux.com> | 2016-06-20 20:14:03 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-21 10:58:29 +0300 |
commit | c6d19ab609d5a7f0eb9385d8dda6b2b5b3d9122f (patch) | |
tree | fe44cde6e91e2cb388d475271dc49a8926974f3c /drivers/net/dsa | |
parent | b7e66a5fad73cb0f118471e6ca8aeed3447915dc (diff) | |
download | linux-c6d19ab609d5a7f0eb9385d8dda6b2b5b3d9122f.tar.xz |
net: dsa: mv88e6xxx: use gpio get optional variant
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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index ad7735dcae84..ec28465ee323 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)) |