Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1532305
| From | Hanjun Guo <guohanjun@huawei.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 06/11] irqchip: gicv3-its: platform-msi: refactor its_pmsi_init() to prepare for ACPI |
| Date | 2016-11-29 14:50 +0100 |
| Message-ID | <sIQXh-F4-71@gated-at.bofh.it> (permalink) |
| References | <sIQXf-F4-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Hanjun Guo <hanjun.guo@linaro.org>
Introduce its_pmsi_init_one() to refactor the code to isolate
ACPI&DT common code to prepare for ACPI later.
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Sinan Kaya <okaya@codeaurora.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Tomasz Nowicki <tn@semihalf.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
drivers/irqchip/irq-gic-v3-its-platform-msi.c | 45 ++++++++++++++++-----------
1 file changed, 27 insertions(+), 18 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
index 16587a9..ff72704 100644
--- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
@@ -84,34 +84,43 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
{},
};
-static int __init its_pmsi_init(void)
+static int __init its_pmsi_init_one(struct fwnode_handle *fwnode,
+ const char *name)
{
- struct device_node *np;
struct irq_domain *parent;
+ parent = irq_find_matching_fwnode(fwnode, DOMAIN_BUS_NEXUS);
+ if (!parent || !msi_get_domain_info(parent)) {
+ pr_err("%s: unable to locate ITS domain\n", name);
+ return -ENXIO;
+ }
+
+ if (!platform_msi_create_irq_domain(fwnode, &its_pmsi_domain_info,
+ parent)) {
+ pr_err("%s: unable to create platform domain\n", name);
+ return -ENXIO;
+ }
+
+ pr_info("Platform MSI: %s domain created\n", name);
+ return 0;
+}
+
+static void __init its_pmsi_of_init(void)
+{
+ struct device_node *np;
+
for (np = of_find_matching_node(NULL, its_device_id); np;
np = of_find_matching_node(np, its_device_id)) {
if (!of_property_read_bool(np, "msi-controller"))
continue;
- parent = irq_find_matching_host(np, DOMAIN_BUS_NEXUS);
- if (!parent || !msi_get_domain_info(parent)) {
- pr_err("%s: unable to locate ITS domain\n",
- np->full_name);
- continue;
- }
-
- if (!platform_msi_create_irq_domain(of_node_to_fwnode(np),
- &its_pmsi_domain_info,
- parent)) {
- pr_err("%s: unable to create platform domain\n",
- np->full_name);
- continue;
- }
-
- pr_info("Platform MSI: %s domain created\n", np->full_name);
+ its_pmsi_init_one(of_node_to_fwnode(np), np->full_name);
}
+}
+static int __init its_pmsi_init(void)
+{
+ its_pmsi_of_init();
return 0;
}
early_initcall(its_pmsi_init);
--
1.7.12.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/11] ACPI platform MSI support Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 10/11] ACPI: ARM64: IORT: rework iort_node_get_id() for NC->SMMU->ITS case Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 11/11] msi: platform: make platform_msi_create_device_domain() ACPI aware Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 09/11] ACPI: platform: setup MSI domain for ACPI based platform device Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 06/11] irqchip: gicv3-its: platform-msi: refactor its_pmsi_init() to prepare for ACPI Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 05/11] ACPI: platform-msi: retrieve dev id from IORT Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100 [PATCH v4 07/11] irqchip: gicv3-its: platform-msi: scan MADT to create platform msi domain Hanjun Guo <guohanjun@huawei.com> - 2016-11-29 14:50 +0100
csiph-web