Skip to content

Commit 5043e55

Browse files
andy-shevmiquelraynal
authored andcommitted
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 <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 1162bc2 commit 5043e55

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/mtd/mtdcore.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,10 +1015,9 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd)
10151015
err:
10161016
nvmem_unregister(mtd->otp_user_nvmem);
10171017
/* Don't report error if OTP is not supported. */
1018-
if (err != -EOPNOTSUPP)
1019-
return dev_err_probe(dev, err,
1020-
"Failed to register OTP NVMEM device\n");
1021-
return 0;
1018+
if (err == -EOPNOTSUPP)
1019+
return 0;
1020+
return dev_err_probe(dev, err, "Failed to register OTP NVMEM device\n");
10221021
}
10231022

10241023
/**

0 commit comments

Comments
 (0)