media: i2c: ov7251: Make the enable GPIO optional.

Not all implementations wire up the enable GPIO and may just tie
it to a supply rail.
Make it optional.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2021-12-14 17:18:49 +00:00
committed by Dom Cobley
parent dad09959f7
commit 6a3dc31d29

View File

@@ -1682,7 +1682,7 @@ static int ov7251_probe(struct i2c_client *client)
return PTR_ERR(ov7251->analog_regulator); return PTR_ERR(ov7251->analog_regulator);
} }
ov7251->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); ov7251->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(ov7251->enable_gpio)) { if (IS_ERR(ov7251->enable_gpio)) {
dev_err(dev, "cannot get enable gpio\n"); dev_err(dev, "cannot get enable gpio\n");
return PTR_ERR(ov7251->enable_gpio); return PTR_ERR(ov7251->enable_gpio);