lkml.org 
[lkml]   [2023]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 09/21] nvmem: core: return -ENOENT if nvmem cell is not found
Am 2023-03-07 17:53, schrieb Miquel Raynal:
> From: Michael Walle <michael@walle.cc>
>
> Prior to commit 3cb05fdbaed6 ("nvmem: core: add an index parameter to
> the cell") of_nvmem_cell_get() would return -ENOENT if the cell wasn't
> found. Particularly, if of_property_match_string() returned -EINVAL,
> that return code was passed as the index to of_parse_phandle(), which
> then detected it as invalid and returned NULL. That led to an return
> code of -ENOENT.
>
> With the new code, the negative index will lead to an -EINVAL of
> of_parse_phandle_with_optional_args() which pass straight to the
> caller and break those who expect an -ENOENT.
>
> Fix it by always returning -ENOENT.
>
> Fixes: efff2655ab0f ("nvmem: core: add an index parameter to the cell")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Signed-off-by: Michael Walle <michael@walle.cc>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Misses the Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
tag. But.. this is already applied anyways:
https://lore.kernel.org/r/515d5fed-2083-c1fd-eea5-148d9e1c45bd@linaro.org/

-michael

\
 
 \ /
  Last update: 2023-03-27 00:47    [W:0.127 / U:2.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site