提交 6a097098 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

media: ccs: Stop reading arrays after the first zero

The register arrays have a certain size but not all the entries will be
relevant. In practice reading can be stopped after encountering a zero
value in the array. Do that to avoid extra reads.
Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 a11d3d68
......@@ -199,6 +199,9 @@ static int ccs_read_all_limits(struct ccs_sensor *sensor)
goto out_err;
}
if (!val && j)
break;
ccs_assign_limit(ptr, width, val);
dev_dbg(&client->dev, "0x%8.8x \"%s\" = %u, 0x%x\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册