[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240605180238.2617808-1-joychakr@google.com>
Date: Wed, 5 Jun 2024 18:02:31 +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>, kernel test robot <lkp@...el.com>
Subject: [PATCH v1 10/17] mtd: core: Change nvmem reg_read/write return type
Change nvmem read/write function definition return type to ssize_t.
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/
Signed-off-by: Joy Chakraborty <joychakr@...gle.com>
---
drivers/mtd/mtdcore.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 724f917f91ba..b13752ec2f1c 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -530,8 +530,8 @@ int mtd_pairing_groups(struct mtd_info *mtd)
}
EXPORT_SYMBOL_GPL(mtd_pairing_groups);
-static int mtd_nvmem_reg_read(void *priv, unsigned int offset,
- void *val, size_t bytes)
+static ssize_t mtd_nvmem_reg_read(void *priv, unsigned int offset,
+ void *val, size_t bytes)
{
struct mtd_info *mtd = priv;
size_t retlen;
@@ -541,7 +541,7 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset,
if (err && err != -EUCLEAN)
return err;
- return retlen == bytes ? 0 : -EIO;
+ return retlen;
}
static int mtd_nvmem_add(struct mtd_info *mtd)
@@ -919,8 +919,8 @@ static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd,
return nvmem;
}
-static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset,
- void *val, size_t bytes)
+static ssize_t mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset,
+ void *val, size_t bytes)
{
struct mtd_info *mtd = priv;
size_t retlen;
@@ -930,11 +930,11 @@ static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset,
if (ret)
return ret;
- return retlen == bytes ? 0 : -EIO;
+ return retlen;
}
-static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset,
- void *val, size_t bytes)
+static ssize_t mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset,
+ void *val, size_t bytes)
{
struct mtd_info *mtd = priv;
size_t retlen;
@@ -944,7 +944,7 @@ static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset,
if (ret)
return ret;
- return retlen == bytes ? 0 : -EIO;
+ return retlen;
}
static int mtd_otp_nvmem_add(struct mtd_info *mtd)
--
2.45.1.467.gbab1589fc0-goog
Powered by blists - more mailing lists