2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 14:43:58 +08:00

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: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Sakari Ailus 2020-05-27 10:35:01 +02:00 committed by Mauro Carvalho Chehab
parent a11d3d6891
commit 6a0970986e

View File

@ -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",