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 <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 (cherry picked from commit 5043e5553601504995300c98141230f5edd11933) Signed-off-by: Aaron Ma <aaron.ma@canonical.com> Acked-by: Jacob Martin <jacob.martin@canonical.com> Acked-by: Tim Whisonant <tim.whisonant@canonical.com> Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
836d6c207c
commit
3fa5b1e812
@@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user