diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2017-10-17 14:05:11 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2017-10-27 17:15:36 +0300 |
commit | 9d39e46bdd9df945669a9039660a3194bdc8d0ac (patch) | |
tree | 2cba8f08f52a28b05fbac326b1c51f94e23f62bb /drivers/media/i2c/tc358743.c | |
parent | cef6673440a29a9a2fd39a57d5ba28e6c68c7a76 (diff) | |
download | linux-9d39e46bdd9df945669a9039660a3194bdc8d0ac.tar.xz |
media: tc358743: validate lane count
The TC358743 does not support more than 4 data lanes. Check that the
lane count is valid.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c/tc358743.c')
-rw-r--r-- | drivers/media/i2c/tc358743.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 0b65096613d9..d3cf016ad0a0 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1941,6 +1941,11 @@ static int tc358743_probe_of(struct tc358743_state *state) goto free_endpoint; } + if (endpoint->bus.mipi_csi2.num_data_lanes > 4) { + dev_err(dev, "invalid number of lanes\n"); + goto free_endpoint; + } + state->bus = endpoint->bus.mipi_csi2; ret = clk_prepare_enable(refclk); |