From 3fa5b1e8129201c4fe4dc337153b1b260b0ba92c Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 10 Jan 2025 14:03:18 +0800 Subject: [PATCH] mtd: core: Align comment with an action in mtd_otp_nvmem_add() BugLink: https://bugs.launchpad.net/bugs/2070339 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 Reviewed-by: Pratyush Yadav Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20240325151150.3368658-1-andriy.shevchenko@linux.intel.com (cherry picked from commit 5043e5553601504995300c98141230f5edd11933) Signed-off-by: Aaron Ma Acked-by: Jacob Martin Acked-by: Tim Whisonant Signed-off-by: Koichiro Den --- drivers/mtd/mtdcore.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 4c1fdf8a2588..724f917f91ba 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"); } /**