of: fix return value in of_reserved_mem_device_init
Sri Krishna chowdary [Fri, 22 May 2015 06:14:30 +0000 (11:14 +0530)]
Need a way to find out if device node does not have "memory-region"
property. return -ENODEV in such case.

Bug 200027296

Change-Id: Ie729b5bfdf1bf9557fa182330ee0d93bfecdfd84
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/746031
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

drivers/of/of_reserved_mem.c

index eb63946..03b834f 100644 (file)
@@ -247,7 +247,7 @@ int of_reserved_mem_device_init(struct device *dev)
 {
        struct reserved_mem *rmem;
        struct of_phandle_iter iter;
-       int err;
+       int err = -ENODEV;
 
        of_property_for_each_phandle_with_args(iter, dev->of_node, "memory-region",
                                               NULL, 1) {