summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-03-07 15:39:32 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-05-06 15:39:17 -0300
commit806f8ffa8a0fa9a6f0481c5648c27aa51d10fdc6 (patch)
treee233de2466d61295a45e07558c4a253fc59d6da9 /drivers/media
parente8364275f9a34481c9a38be757b675f8d1689d46 (diff)
[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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/adp1653.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index fb7ed730d932..9e1731c565e7 100644
--- a/drivers/media/i2c/adp1653.c
+++ b/drivers/media/i2c/adp1653.c
@@ -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;