@@ -151,12 +151,15 @@ struct video_i2c_chip {
int (*hwmon_init)(struct video_i2c_data *data);
};
-static int mlx90640_nvram_read(void *priv, unsigned int offset, void *val,
- size_t bytes)
+static ssize_t mlx90640_nvram_read(void *priv, unsigned int offset, void *val,
+ size_t bytes)
{
struct video_i2c_data *data = priv;
+ int ret;
+
+ ret = regmap_bulk_read(data->regmap, MLX90640_EEPROM_START_ADDR + offset, val, bytes);
- return regmap_bulk_read(data->regmap, MLX90640_EEPROM_START_ADDR + offset, val, bytes);
+ return ret < 0 ? ret : bytes;
}
static struct nvmem_config mlx90640_nvram_config = {
Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty <joychakr@google.com> --- drivers/media/i2c/video-i2c.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)