Revert "of/irq: Support #msi-cells=<0> in of_msi_get_domain"

This reverts commit b6e08f91ee.
This commit is contained in:
Ksawlii 2024-11-24 00:23:03 +01:00
parent 086b0d40c1
commit 1c9106694e

View file

@ -642,7 +642,8 @@ struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id,
* @np: device node for @dev * @np: device node for @dev
* @token: bus type for this domain * @token: bus type for this domain
* *
* Parse the msi-parent property and returns the corresponding MSI domain. * Parse the msi-parent property (both the simple and the complex
* versions), and returns the corresponding MSI domain.
* *
* Returns: the MSI domain for this device (or NULL on failure). * Returns: the MSI domain for this device (or NULL on failure).
*/ */
@ -650,14 +651,33 @@ struct irq_domain *of_msi_get_domain(struct device *dev,
struct device_node *np, struct device_node *np,
enum irq_domain_bus_token token) enum irq_domain_bus_token token)
{ {
struct of_phandle_iterator it; struct device_node *msi_np;
struct irq_domain *d; struct irq_domain *d;
int err;
of_for_each_phandle(&it, err, np, "msi-parent", "#msi-cells", 0) { /* Check for a single msi-parent property */
d = irq_find_matching_host(it.node, token); msi_np = of_parse_phandle(np, "msi-parent", 0);
if (d) if (msi_np && !of_property_read_bool(msi_np, "#msi-cells")) {
return d; d = irq_find_matching_host(msi_np, token);
if (!d)
of_node_put(msi_np);
return d;
}
if (token == DOMAIN_BUS_PLATFORM_MSI) {
/* Check for the complex msi-parent version */
struct of_phandle_args args;
int index = 0;
while (!of_parse_phandle_with_args(np, "msi-parent",
"#msi-cells",
index, &args)) {
d = irq_find_matching_host(args.np, token);
if (d)
return d;
of_node_put(args.np);
index++;
}
} }
return NULL; return NULL;