提交 2f23ecbf 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

media: ccs: Add a sanity check for external clock frequency

The driver depends on the external clock frequency. Add a sanity check for
the frequency, by returning an error from probe if it's zero.
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 2fed6c84
......@@ -3275,6 +3275,11 @@ static int ccs_probe(struct i2c_client *client)
return -EINVAL;
}
if (!sensor->hwcfg.ext_clk) {
dev_err(&client->dev, "cannot work with xclk frequency 0\n");
return -EINVAL;
}
sensor->reset = devm_gpiod_get_optional(&client->dev, "reset",
GPIOD_OUT_HIGH);
if (IS_ERR(sensor->reset))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册