diff options
| author | Sakari Ailus <[email protected]> | 2019-06-06 10:21:25 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2019-06-21 17:54:25 -0400 |
| commit | e14b77c3db5c97c5ef67f508cc302571163dbbca (patch) | |
| tree | 4b6cd010cf6c6c62285ccbcc1a0ed7f8491bd25d | |
| parent | 4ace2d28aba594e234923f55f476e97c56f6689a (diff) | |
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 <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
| -rw-r--r-- | drivers/media/i2c/ov9640.c | 4 |
1 files 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; } |