Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6d19ab6 authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller
Browse files

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: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b7e66a5f
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -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))