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

Commit 97438abc authored by Pan Bian's avatar Pan Bian Committed by David S. Miller
Browse files

net: dsa: lan9303: correctly check return value of devm_gpiod_get_optional



Function devm_gpiod_get_optional() returns an ERR_PTR on failure. Its
return value should not be validated by a NULL check. Instead, use IS_ERR.

Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3697d058
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1301,7 +1301,7 @@ static void lan9303_probe_reset_gpio(struct lan9303 *chip,
	chip->reset_gpio = devm_gpiod_get_optional(chip->dev, "reset",
						   GPIOD_OUT_LOW);

	if (!chip->reset_gpio) {
	if (IS_ERR(chip->reset_gpio)) {
		dev_dbg(chip->dev, "No reset GPIO defined\n");
		return;
	}