提交 c6d19ab6 编写于 作者: V Vivien Didelot 提交者: David S. Miller

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: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b7e66a5f
...@@ -3744,16 +3744,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev) ...@@ -3744,16 +3744,9 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
if (!ps->info) if (!ps->info)
return -ENODEV; return -ENODEV;
ps->reset = devm_gpiod_get(dev, "reset", GPIOD_ASIS); ps->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS);
if (IS_ERR(ps->reset)) { if (IS_ERR(ps->reset))
err = PTR_ERR(ps->reset); return PTR_ERR(ps->reset);
if (err == -ENOENT) {
/* Optional, so not an error */
ps->reset = NULL;
} else {
return err;
}
}
if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM) && if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM) &&
!of_property_read_u32(np, "eeprom-length", &eeprom_len)) !of_property_read_u32(np, "eeprom-length", &eeprom_len))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册