[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240605175953.2613260-7-joychakr@google.com>
Date: Wed, 5 Jun 2024 17:59:50 +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 06/17] misc: eeprom: at24: 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/misc/eeprom/at24.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 4bd4f32bcdab..0e8d92d6ab1e 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -424,8 +424,9 @@ static ssize_t at24_regmap_write(struct at24_data *at24, const char *buf,
return -ETIMEDOUT;
}
-static int at24_read(void *priv, unsigned int off, void *val, size_t count)
+static ssize_t at24_read(void *priv, unsigned int off, void *val, size_t count)
{
+ size_t bytes_read = count;
struct at24_data *at24;
struct device *dev;
char *buf = val;
@@ -465,11 +466,12 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
if (unlikely(at24->read_post))
at24->read_post(off, buf, i);
- return 0;
+ return bytes_read;
}
-static int at24_write(void *priv, unsigned int off, void *val, size_t count)
+static ssize_t at24_write(void *priv, unsigned int off, void *val, size_t count)
{
+ size_t bytes_written = count;
struct at24_data *at24;
struct device *dev;
char *buf = val;
@@ -509,7 +511,7 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
pm_runtime_put(dev);
- return 0;
+ return bytes_written;
}
static int at24_make_dummy_client(struct at24_data *at24, unsigned int index,
--
2.45.1.467.gbab1589fc0-goog
Powered by blists - more mailing lists