From 9f5a802b1d51dc80a27d828a5f7dcc8ec4a72f03 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 8 Jun 2016 03:51:53 -0300 Subject: [PATCH] [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: 59ce4039727ef40 ("of: reserved_mem: add support for using more than one region for given device") Reported-by: Liviu Dudau Signed-off-by: Marek Szyprowski Reviewed-by: Sylwester Nawrocki Reviewed-by: Liviu Dudau Acked-by: Rob Herring Reviewed-by: Sumit Semwal --- drivers/of/of_reserved_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 04e4fe58fb0c..2b2291bfc38f 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -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); -- 2.20.1