diff options
author | 2020-05-27 10:35:01 +0200 | |
---|---|---|
committer | 2020-12-03 12:27:31 +0100 | |
commit | 6a0970986e425f5750b081542c340c855d8890e5 (patch) | |
tree | 2496437fb78fc497daf8d2333beff1d3ebbbbb6b | |
parent | media: ccs: Read CCS static data from firmware binaries (diff) | |
download | linux-6a0970986e425f5750b081542c340c855d8890e5.tar.gz linux-6a0970986e425f5750b081542c340c855d8890e5.tar.bz2 linux-6a0970986e425f5750b081542c340c855d8890e5.zip |
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>
-rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index be27b002a772..dec248fe7cc1 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -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", |