[media] of: reserved_mem: restore old behavior when no region is defined
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 8 Jun 2016 06:51:53 +0000 (03:51 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 9 Jun 2016 09:55:15 +0000 (06:55 -0300)
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 <liviu.dudau@arm.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sumit Semwal <sumit.semwal@linaro.org>
drivers/of/of_reserved_mem.c

index 04e4fe58fb0c82ad125a676a78882d8294969eaf..2b2291bfc38f8409271c735d21ab0a62adcd9179 100644 (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);