lkml.org 
[lkml]   [2019]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/13] nvmem: core: Fix of_nvmem_cell_get() for optional cells
    Date
    From: Alban Bedel <albeu@free.fr>

    of_nvmem_cell_get() should return -ENOENT when a cell isn't defined,
    otherwise callers can't distinguish between a missing cell and other
    errors.

    Signed-off-by: Alban Bedel <albeu@free.fr>
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
    ---
    drivers/nvmem/core.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
    index cf2e1091fe89..f8c43da6f2ca 100644
    --- a/drivers/nvmem/core.c
    +++ b/drivers/nvmem/core.c
    @@ -1031,7 +1031,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id)

    cell_np = of_parse_phandle(np, "nvmem-cells", index);
    if (!cell_np)
    - return ERR_PTR(-EINVAL);
    + return ERR_PTR(-ENOENT);

    nvmem_np = of_get_next_parent(cell_np);
    if (!nvmem_np)
    --
    2.20.1
    \
     
     \ /
      Last update: 2019-01-28 18:37    [W:2.702 / U:0.572 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site