Commit 9f5a802b authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Mauro Carvalho Chehab

[media] of: reserved_mem: restore old behavior when no region is defined

Change return value back to -ENODEV when no region is defined for given
device. This restores old behavior of this function, as some drivers rely
on such error code.

Fixes: 59ce4039 ("of: reserved_mem: add support for using more than
       one region for given device")
Reported-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
parent bd3df3c5
...@@ -327,7 +327,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev, ...@@ -327,7 +327,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
target = of_parse_phandle(np, "memory-region", idx); target = of_parse_phandle(np, "memory-region", idx);
if (!target) if (!target)
return -EINVAL; return -ENODEV;
rmem = __find_rmem(target); rmem = __find_rmem(target);
of_node_put(target); of_node_put(target);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment