[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: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Vladimir Zapolskiy 2016-03-07 15:39:32 -03:00 committed by Mauro Carvalho Chehab
parent e8364275f9
commit 806f8ffa8a

View file

@ -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;