[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: 59ce403972 ("of: reserved_mem: add support for using more than
       one region for given device")

Reported-by: Liviu Dudau <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Reviewed-by: Sylwester Nawrocki <[email protected]>
Reviewed-by: Liviu Dudau <[email protected]>
Acked-by: Rob Herring <[email protected]>
Reviewed-by: Sumit Semwal <[email protected]>
This commit is contained in:
Marek Szyprowski 2016-06-08 03:51:53 -03:00 • committed by Mauro Carvalho Chehab
commit 9f5a802b1d

View file

@ -327,7 +327,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
target = of_parse_phandle(np, "memory-region", idx);
if (!target)
return -EINVAL;
return -ENODEV;
rmem = __find_rmem(target);
of_node_put(target);