public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v1 10/17] mtd: core: Change nvmem reg_read/write return type
@ 2024-06-05 18:02 Joy Chakraborty
  2024-06-05 18:02 ` [PATCH v1 11/17] mtd: ubi: nvmem: " Joy Chakraborty
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Joy Chakraborty @ 2024-06-05 18:02 UTC (permalink / raw)
  To: Srinivas Kandagatla, Greg Kroah-Hartman,
	AngeloGioacchino Del Regno, Lars-Peter Clausen, Sakari Ailus,
	Bingbu Cao, Zhihao Cheng, Jerome Brunet, Martin Blumenstingl
  Cc: linux-hwmon, linux-kernel, linux-iio, linux-media, linux-i2c,
	linux-gpio, linux-mtd, linux-rtc, linux-arm-kernel, linux-amlogic,
	linux-sunxi, linux-tegra, linux-usb, manugautam, Joy Chakraborty,
	kernel test robot

Change nvmem read/write function definition return type to ssize_t.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/
Signed-off-by: Joy Chakraborty <joychakr@google.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


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-05 19:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-05 18:02 [PATCH v1 10/17] mtd: core: Change nvmem reg_read/write return type Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 11/17] mtd: ubi: nvmem: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 12/17] soc: atmel: sfr: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 13/17] w1: slaves: w1_ds250x: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 14/17] thunderbolt: switch: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 15/17] thunderbolt: retimer: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 16/17] soc: tegra: fuse: " Joy Chakraborty
2024-06-05 18:02 ` [PATCH v1 17/17] rtc: " Joy Chakraborty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox