* [PATCH] media: i2c/adp1653: fix check of devm_gpiod_get() error code
@ 2016-03-07 18:39 Vladimir Zapolskiy
2016-03-09 9:44 ` Sakari Ailus
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Zapolskiy @ 2016-03-07 18:39 UTC (permalink / raw)
To: Sakari Ailus, Mauro Carvalho Chehab; +Cc: linux-media
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>
---
drivers/media/i2c/adp1653.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/adp1653.c b/drivers/media/i2c/adp1653.c
index fb7ed73..9e1731c 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;
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-09 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-07 18:39 [PATCH] media: i2c/adp1653: fix check of devm_gpiod_get() error code Vladimir Zapolskiy
2016-03-09 9:44 ` Sakari Ailus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).