@@ -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)
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(-)