From: Lad Prabhakar Date: Fri, 4 Sep 2020 20:18:35 +0000 (+0200) Subject: media: i2c: ov5640: Fail probe on unsupported bus_type X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~1054^2~252 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=2c61e48d0a19eff9c404e1911ec6c63c555eb0c4;p=linux.git media: i2c: ov5640: Fail probe on unsupported bus_type Fail probe if unsupported bus_type is detected. Signed-off-by: Lad Prabhakar Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 16f830bdf715..8d0254d0e5ea 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -3072,6 +3072,13 @@ static int ov5640_probe(struct i2c_client *client) return ret; } + if (sensor->ep.bus_type != V4L2_MBUS_PARALLEL && + sensor->ep.bus_type != V4L2_MBUS_CSI2_DPHY && + sensor->ep.bus_type != V4L2_MBUS_BT656) { + dev_err(dev, "Unsupported bus type %d\n", sensor->ep.bus_type); + return -EINVAL; + } + /* get system clock (xclk) */ sensor->xclk = devm_clk_get(dev, "xclk"); if (IS_ERR(sensor->xclk)) {