Skip to contentSkip to conversation

ov8856: Check reading clock frequency succeeded

PATCH New Sakari Ailus 1 participant 1 message Aug 7, 2019

Subsystems (3)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/media/i2c/ov8856.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/media/i2c/ov8856.c +4 -1
index cd347d6b7b9da..8655842af2755 100644
@@ -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;
Signature · 1 line
2.20.1