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 <hverkuil-ci...@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
---
 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;
        }
-- 
2.11.0

Reply via email to