diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2019-08-07 11:34:43 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-15 14:05:40 +0300 |
commit | fa4bb7d3acbfb7926d1b46ce6568922bfc99ffeb (patch) | |
tree | e5fabbb4074c68f41f60a79988044883f4c3fedf /drivers | |
parent | bf27502b1f3bf8095bf81736e506d354a2ce9ec4 (diff) | |
download | linux-fa4bb7d3acbfb7926d1b46ce6568922bfc99ffeb.tar.xz |
media: ov8856: Check reading clock frequency succeeded
Instead of blindly trusting getting the clock frequency succeeded end then
testing it against a pre-defined value, verify reading the value
succeeded.
Fixes: 879347f0c258 ("media: ov8856: Add support for OV8856 sensor")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/ov8856.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov8856.c b/drivers/media/i2c/ov8856.c index cd347d6b7b9d..8655842af275 100644 --- a/drivers/media/i2c/ov8856.c +++ b/drivers/media/i2c/ov8856.c @@ -1106,7 +1106,10 @@ static int ov8856_check_hwcfg(struct device *dev) if (!fwnode) return -ENXIO; - fwnode_property_read_u32(fwnode, "clock-frequency", &mclk); + ret = fwnode_property_read_u32(fwnode, "clock-frequency", &mclk); + if (ret) + return ret; + if (mclk != OV8856_MCLK) { dev_err(dev, "external clock %d is not supported", mclk); return -EINVAL; |