mirror of https://gitee.com/openkylin/linux.git
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 <hverkuil-cisco@xs4all.nl> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
4ace2d28ab
commit
e14b77c3db
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue