From e14b77c3db5c97c5ef67f508cc302571163dbbca Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 6 Jun 2019 10:21:25 -0400 Subject: [PATCH] media: ov9640: Don't check for NULL on devm_gpiod_get return values devm_gpiod_get never returns NULL; therefore it's not necessary to check for that. PTR_ERR(NULL) also yields zero, which is confusing to smatch. Reported-by: Hans Verkuil Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov9640.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov9640.c b/drivers/media/i2c/ov9640.c index d6831f28378b..482609665305 100644 --- a/drivers/media/i2c/ov9640.c +++ b/drivers/media/i2c/ov9640.c @@ -691,14 +691,14 @@ static int ov9640_probe(struct i2c_client *client, priv->gpio_power = devm_gpiod_get(&client->dev, "Camera power", GPIOD_OUT_LOW); - if (IS_ERR_OR_NULL(priv->gpio_power)) { + if (IS_ERR(priv->gpio_power)) { ret = PTR_ERR(priv->gpio_power); return ret; } priv->gpio_reset = devm_gpiod_get(&client->dev, "Camera reset", GPIOD_OUT_HIGH); - if (IS_ERR_OR_NULL(priv->gpio_reset)) { + if (IS_ERR(priv->gpio_reset)) { ret = PTR_ERR(priv->gpio_reset); return ret; }