Merge tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof...
[linux-block.git] / drivers / irqchip / irq-mbigen.c
index d6763ea9f310de0a88279c4ff2ca9c4aa172ea3b..eada5e0e3eb956c939be7d6eef06e1a0a4aedd39 100644 (file)
@@ -245,11 +245,14 @@ static int mbigen_of_create_domain(struct platform_device *pdev,
                if (!of_property_read_bool(np, "interrupt-controller"))
                        continue;
 
-               parent = platform_bus_type.dev_root;
-               child = of_platform_device_create(np, NULL, parent);
-               if (!child) {
-                       of_node_put(np);
-                       return -ENOMEM;
+               parent = bus_get_dev_root(&platform_bus_type);
+               if (parent) {
+                       child = of_platform_device_create(np, NULL, parent);
+                       put_device(parent);
+                       if (!child) {
+                               of_node_put(np);
+                               return -ENOMEM;
+                       }
                }
 
                if (of_property_read_u32(child->dev.of_node, "num-pins",