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

Commit 806f8ffa authored by Vladimir Zapolskiy's avatar Vladimir Zapolskiy Committed by Mauro Carvalho Chehab
Browse files

[media] media: i2c/adp1653: fix check of devm_gpiod_get() error code



The devm_gpiod_get() function returns either a valid pointer to
struct gpio_desc or ERR_PTR() error value, check for NULL is bogus.

Signed-off-by: default avatarVladimir Zapolskiy <vz@mleia.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent e8364275
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -466,9 +466,9 @@ static int adp1653_of_init(struct i2c_client *client,
	of_node_put(child);

	pd->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW);
	if (!pd->enable_gpio) {
	if (IS_ERR(pd->enable_gpio)) {
		dev_err(&client->dev, "Error getting GPIO\n");
		return -EINVAL;
		return PTR_ERR(pd->enable_gpio);
	}

	return 0;