8-bit reads are needed in some cases; however the condition used was wrong.
Regular access (register width) was used if:
len == SMIAPP_REG_8BIT && !only8
This causes 8-bit read access to be used always. The operator should be ||
instead: regular access can be used for 8-bit reads OR if allowed otherwise.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
&& len != SMIAPP_REG_32BIT)
return -EINVAL;
- if (len == SMIAPP_REG_8BIT && !only8)
+ if (len == SMIAPP_REG_8BIT || !only8)
rval = ____smiapp_read(sensor, (u16)reg, len, val);
else
rval = ____smiapp_read_8only(sensor, (u16)reg, len, val);