]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/of/platform.c
Merge tag 'platform-drivers-x86-v4.5-1' of git://git.infradead.org/users/dvhart/linux...
[karo-tx-linux.git] / drivers / of / platform.c
index 1001efaedcb8681f08f575ec80b743240dc80893..8d103e4968be4d9b36ca5e1740d8fcfb1c1d9a47 100644 (file)
@@ -31,6 +31,7 @@ const struct of_device_id of_default_bus_match_table[] = {
 #endif /* CONFIG_ARM_AMBA */
        {} /* Empty terminated list */
 };
+EXPORT_SYMBOL(of_default_bus_match_table);
 
 static int of_dev_node_match(struct device *dev, void *data)
 {
@@ -405,8 +406,10 @@ int of_platform_bus_probe(struct device_node *root,
                if (!of_match_node(matches, child))
                        continue;
                rc = of_platform_bus_create(child, matches, NULL, parent, false);
-               if (rc)
+               if (rc) {
+                       of_node_put(child);
                        break;
+               }
        }
 
        of_node_put(root);
@@ -447,8 +450,10 @@ int of_platform_populate(struct device_node *root,
 
        for_each_child_of_node(root, child) {
                rc = of_platform_bus_create(child, matches, lookup, parent, true);
-               if (rc)
+               if (rc) {
+                       of_node_put(child);
                        break;
+               }
        }
        of_node_set_flag(root, OF_POPULATED_BUS);