Commit b5f8fa87 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mauro Carvalho Chehab

media: ar0521: fix error return code in ar0521_power_on()

Return error code if ar0521_write_regs() fails in ar0521_power_on().

Fixes: 852b50ae ("media: On Semi AR0521 sensor driver")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Acked-by: default avatarKrzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 9c6dee9a
......@@ -757,8 +757,9 @@ static int ar0521_power_on(struct device *dev)
usleep_range(4500, 5000); /* min 45000 clocks */
for (cnt = 0; cnt < ARRAY_SIZE(initial_regs); cnt++)
if (ar0521_write_regs(sensor, initial_regs[cnt].data,
initial_regs[cnt].count))
ret = ar0521_write_regs(sensor, initial_regs[cnt].data,
initial_regs[cnt].count);
if (ret)
goto off;
ret = ar0521_write_reg(sensor, AR0521_REG_SERIAL_FORMAT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment