irq-mbigen.c (1ac731c529cd4d6adbce134754b51ff7d822b145) | irq-mbigen.c (fb33a46cd75e18773dd5a414744507d84ae90870) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2015 HiSilicon Limited, All Rights Reserved. 4 * Author: Jun Ma <majun258@huawei.com> 5 * Author: Yun Wu <wuyun.wu@huawei.com> 6 */ 7 8#include <linux/acpi.h> --- 221 unchanged lines hidden (view full) --- 230 .translate = mbigen_domain_translate, 231 .alloc = mbigen_irq_domain_alloc, 232 .free = mbigen_irq_domain_free, 233}; 234 235static int mbigen_of_create_domain(struct platform_device *pdev, 236 struct mbigen_device *mgn_chip) 237{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) 2015 HiSilicon Limited, All Rights Reserved. 4 * Author: Jun Ma <majun258@huawei.com> 5 * Author: Yun Wu <wuyun.wu@huawei.com> 6 */ 7 8#include <linux/acpi.h> --- 221 unchanged lines hidden (view full) --- 230 .translate = mbigen_domain_translate, 231 .alloc = mbigen_irq_domain_alloc, 232 .free = mbigen_irq_domain_free, 233}; 234 235static int mbigen_of_create_domain(struct platform_device *pdev, 236 struct mbigen_device *mgn_chip) 237{ |
238 struct device *parent; | |
239 struct platform_device *child; 240 struct irq_domain *domain; 241 struct device_node *np; 242 u32 num_pins; 243 int ret = 0; 244 | 238 struct platform_device *child; 239 struct irq_domain *domain; 240 struct device_node *np; 241 u32 num_pins; 242 int ret = 0; 243 |
245 parent = bus_get_dev_root(&platform_bus_type); 246 if (!parent) 247 return -ENODEV; 248 | |
249 for_each_child_of_node(pdev->dev.of_node, np) { 250 if (!of_property_read_bool(np, "interrupt-controller")) 251 continue; 252 | 244 for_each_child_of_node(pdev->dev.of_node, np) { 245 if (!of_property_read_bool(np, "interrupt-controller")) 246 continue; 247 |
253 child = of_platform_device_create(np, NULL, parent); | 248 child = of_platform_device_create(np, NULL, NULL); |
254 if (!child) { 255 ret = -ENOMEM; 256 break; 257 } 258 259 if (of_property_read_u32(child->dev.of_node, "num-pins", 260 &num_pins) < 0) { 261 dev_err(&pdev->dev, "No num-pins property\n"); --- 6 unchanged lines hidden (view full) --- 268 &mbigen_domain_ops, 269 mgn_chip); 270 if (!domain) { 271 ret = -ENOMEM; 272 break; 273 } 274 } 275 | 249 if (!child) { 250 ret = -ENOMEM; 251 break; 252 } 253 254 if (of_property_read_u32(child->dev.of_node, "num-pins", 255 &num_pins) < 0) { 256 dev_err(&pdev->dev, "No num-pins property\n"); --- 6 unchanged lines hidden (view full) --- 263 &mbigen_domain_ops, 264 mgn_chip); 265 if (!domain) { 266 ret = -ENOMEM; 267 break; 268 } 269 } 270 |
276 put_device(parent); | |
277 if (ret) 278 of_node_put(np); 279 280 return ret; 281} 282 283#ifdef CONFIG_ACPI 284static const struct acpi_device_id mbigen_acpi_match[] = { --- 116 unchanged lines hidden --- | 271 if (ret) 272 of_node_put(np); 273 274 return ret; 275} 276 277#ifdef CONFIG_ACPI 278static const struct acpi_device_id mbigen_acpi_match[] = { --- 116 unchanged lines hidden --- |