irq-mbigen.c (27988c96687667e74df1a9a3b8662519bc1c29c9) | irq-mbigen.c (321275f0d8f5939f2a98749fe03ee97ac97e73d0) |
---|---|
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> | 1/* 2 * Copyright (C) 2015 Hisilicon Limited, All Rights Reserved. 3 * Author: Jun Ma <majun258@huawei.com> 4 * Author: Yun Wu <wuyun.wu@huawei.com> |
5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
6 */ 7 8#include <linux/acpi.h> 9#include <linux/interrupt.h> 10#include <linux/irqchip.h> 11#include <linux/module.h> 12#include <linux/msi.h> 13#include <linux/of_address.h> --- 222 unchanged lines hidden (view full) --- 236 u32 num_pins; 237 238 for_each_child_of_node(pdev->dev.of_node, np) { 239 if (!of_property_read_bool(np, "interrupt-controller")) 240 continue; 241 242 parent = platform_bus_type.dev_root; 243 child = of_platform_device_create(np, NULL, parent); | 17 */ 18 19#include <linux/acpi.h> 20#include <linux/interrupt.h> 21#include <linux/irqchip.h> 22#include <linux/module.h> 23#include <linux/msi.h> 24#include <linux/of_address.h> --- 222 unchanged lines hidden (view full) --- 247 u32 num_pins; 248 249 for_each_child_of_node(pdev->dev.of_node, np) { 250 if (!of_property_read_bool(np, "interrupt-controller")) 251 continue; 252 253 parent = platform_bus_type.dev_root; 254 child = of_platform_device_create(np, NULL, parent); |
244 if (!child) | 255 if (!child) { 256 of_node_put(np); |
245 return -ENOMEM; | 257 return -ENOMEM; |
258 } |
|
246 247 if (of_property_read_u32(child->dev.of_node, "num-pins", 248 &num_pins) < 0) { 249 dev_err(&pdev->dev, "No num-pins property\n"); | 259 260 if (of_property_read_u32(child->dev.of_node, "num-pins", 261 &num_pins) < 0) { 262 dev_err(&pdev->dev, "No num-pins property\n"); |
263 of_node_put(np); |
|
250 return -EINVAL; 251 } 252 253 domain = platform_msi_create_device_domain(&child->dev, num_pins, 254 mbigen_write_msg, 255 &mbigen_domain_ops, 256 mgn_chip); | 264 return -EINVAL; 265 } 266 267 domain = platform_msi_create_device_domain(&child->dev, num_pins, 268 mbigen_write_msg, 269 &mbigen_domain_ops, 270 mgn_chip); |
257 if (!domain) | 271 if (!domain) { 272 of_node_put(np); |
258 return -ENOMEM; | 273 return -ENOMEM; |
274 } |
|
259 } 260 261 return 0; 262} 263 264#ifdef CONFIG_ACPI 265static int mbigen_acpi_create_domain(struct platform_device *pdev, 266 struct mbigen_device *mgn_chip) --- 115 unchanged lines hidden --- | 275 } 276 277 return 0; 278} 279 280#ifdef CONFIG_ACPI 281static int mbigen_acpi_create_domain(struct platform_device *pdev, 282 struct mbigen_device *mgn_chip) --- 115 unchanged lines hidden --- |