Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5087cc19 authored by Alban Bedel's avatar Alban Bedel Committed by Greg Kroah-Hartman
Browse files

nvmem: core: Fix of_nvmem_cell_get() for optional cells



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: default avatarAlban Bedel <albeu@free.fr>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1716cfe8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)