From: Rob Herring <r...@kernel.org>

of_platform_populate does not return an error if creating the platform
device fails. This means almost any error from driver core cannot be
detected by the caller. Fix this.

Signed-off-by: Rob Herring <r...@kernel.org>
---
 drivers/of/platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 404d1da..622aeb3 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -391,7 +391,9 @@ static int of_platform_bus_create(struct device_node *bus,
        }
 
        dev = of_platform_device_create_pdata(bus, bus_id, platform_data, 
parent);
-       if (!dev || !of_match_node(matches, bus))
+       if (!dev)
+               return -ENODEV;
+       if (!of_match_node(matches, bus))
                return 0;
 
        for_each_child_of_node(bus, child) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to