aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-03-25 17:11:50 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2024-04-09 08:35:34 +0200
commit5043e5553601504995300c98141230f5edd11933 (patch)
tree57ce41ec44b04ea41b374d37702eb0212a6bb84d
parent1162bc2f8f5de7da23d18aa4b7fbd4e93c369c50 (diff)
mtd: core: Align comment with an action in mtd_otp_nvmem_add()
The comment is related to the non-error case, make it more clear by inverting the condition. It also makes code neater at the end. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Pratyush Yadav <pratyush@kernel.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240325151150.3368658-1-andriy.shevchenko@linux.intel.com
-rw-r--r--drivers/mtd/mtdcore.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9e18422fdc77..d0c231600f84 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1015,10 +1015,9 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd)
err:
nvmem_unregister(mtd->otp_user_nvmem);
/* Don't report error if OTP is not supported. */
- if (err != -EOPNOTSUPP)
- return dev_err_probe(dev, err,
- "Failed to register OTP NVMEM device\n");
- return 0;
+ if (err == -EOPNOTSUPP)
+ return 0;
+ return dev_err_probe(dev, err, "Failed to register OTP NVMEM device\n");
}
/**