mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mtd: Fix the check on nvmem_register() ret code
Commit20167b70c8("nvmem: use EOPNOTSUPP instead of ENOSYS") changed the nvmem_register() ret code from ENOSYS to EOPNOTSUPP when CONFIG_NVMEM is not enabled, but the check in mtd_nvmem_add() was not adjusted accordingly. Cc: Bartosz Golaszewski <[email protected]> Cc: Alban Bedel <[email protected]> Fixes:c4dfa25ab3("mtd: add support for reading MTD devices via the nvmem API") Reported-by: kernel test robot <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
This commit is contained in:
parent
bfeffd1552
commit
19e16fb4f3
1 changed files with 1 additions and 1 deletions
|
|
@ -522,7 +522,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
|
|||
mtd->nvmem = nvmem_register(&config);
|
||||
if (IS_ERR(mtd->nvmem)) {
|
||||
/* Just ignore if there is no NVMEM support in the kernel */
|
||||
if (PTR_ERR(mtd->nvmem) == -ENOSYS) {
|
||||
if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
|
||||
mtd->nvmem = NULL;
|
||||
} else {
|
||||
dev_err(&mtd->dev, "Failed to register NVMEM device\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue