[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240605175953.2613260-4-joychakr@google.com>
Date: Wed, 5 Jun 2024 17:59:47 +0000
From: Joy Chakraborty <joychakr@...gle.com>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Lars-Peter Clausen <lars@...afoo.de>, Sakari Ailus <sakari.ailus@...ux.intel.com>,
Bingbu Cao <bingbu.cao@...el.com>, Zhihao Cheng <chengzhihao1@...wei.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-iio@...r.kernel.org, linux-media@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-mtd@...ts.infradead.org, linux-rtc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-amlogic@...ts.infradead.org,
linux-sunxi@...ts.linux.dev, linux-tegra@...r.kernel.org,
linux-usb@...r.kernel.org, manugautam@...gle.com,
Joy Chakraborty <joychakr@...gle.com>
Subject: [PATCH v1 03/17] media: i2c: video-i2c: Change nvmem reg_read/write
return type
Change nvmem read/write function definition return type to ssize_t.
Signed-off-by: Joy Chakraborty <joychakr@...gle.com>
---
drivers/media/i2c/video-i2c.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 56dbe07a1c99..2bfc221b5104 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -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 = {
--
2.45.1.467.gbab1589fc0-goog
Powered by blists - more mailing lists