diff options
Diffstat (limited to 'drivers/irqchip/irq-mbigen.c')
-rw-r--r-- | drivers/irqchip/irq-mbigen.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index f3faf5c99770..eada5e0e3eb9 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -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", @@ -389,5 +392,4 @@ module_platform_driver(mbigen_platform_driver); MODULE_AUTHOR("Jun Ma <majun258@huawei.com>"); MODULE_AUTHOR("Yun Wu <wuyun.wu@huawei.com>"); -MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("HiSilicon MBI Generator driver"); |