]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: ov9640: Don't check for NULL on devm_gpiod_get return values
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 6 Jun 2019 14:21:25 +0000 (10:21 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 21:54:25 +0000 (17:54 -0400)
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-cisco@xs4all.nl>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov9640.c

index d6831f28378b7225a26194ecce47587c1119951f..4826096653056f6b3d014351c2f7f1f70a8dce8a 100644 (file)
@@ -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;
        }