summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/nvmem/core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b4c09bc20b67..31ca04d46c1c 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -953,9 +953,9 @@ nvmem_cell_get_from_lookup(struct device *dev, const char *con_id)
(strcmp(lookup->con_id, con_id) == 0)) {
/* This is the right entry. */
nvmem = __nvmem_device_get(NULL, lookup->nvmem_name);
- if (!nvmem) {
+ if (IS_ERR(nvmem)) {
/* Provider may not be registered yet. */
- cell = ERR_PTR(-EPROBE_DEFER);
+ cell = ERR_CAST(nvmem);
goto out;
}
@@ -963,6 +963,7 @@ nvmem_cell_get_from_lookup(struct device *dev, const char *con_id)
lookup->cell_name);
if (!cell) {
__nvmem_device_put(nvmem);
+ cell = ERR_PTR(-ENOENT);
goto out;
}
}