mtd: Fix the check on nvmem_register() ret code
authorBoris Brezillon <bbrezillon@kernel.org>
Wed, 2 Jan 2019 14:36:53 +0000 (15:36 +0100)
committerBoris Brezillon <bbrezillon@kernel.org>
Mon, 7 Jan 2019 13:06:22 +0000 (14:06 +0100)
commit19e16fb4f319b84b3220e98abf726218beba8c34
tree5616fff2dbeaad693158661df45b56273c6ca28c
parentbfeffd155283772bbe78c6a05dec7c0128ee500c
mtd: Fix the check on nvmem_register() ret code

Commit 20167b70c894 ("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 <brgl@bgdev.pl>
Cc: Alban Bedel <albeu@free.fr>
Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
drivers/mtd/mtdcore.c