of/irq: make of_msi_map_get_device_domain() bus agnostic

[ Upstream commit 6f881aba01109a01a43e4f135673c19190f61133 ]

of_msi_map_get_device_domain() is PCI specific but it need not be and
can be easily changed to be bus agnostic in order to be used by other
busses by adding an IRQ domain bus token as an input parameter.

Signed-off-by: Diana Craciun <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>   # pci/msi.c
Cc: Bjorn Helgaas <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
Stable-dep-of: d79972789d17 ("of: dynamic: Fix of_reconfig_get_state_change() return value documentation")
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Diana Craciun 2020-06-19 09:20:10 +01:00 • committed by Greg Kroah-Hartman
commit ae374c57af
3 changed files with 9 additions and 6 deletions

View file

@ -613,18 +613,20 @@ u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in)
* of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
* @dev: device for which the mapping is to be done.
* @rid: Requester ID for the device.
* @bus_token: Bus token
*
* Walk up the device hierarchy looking for devices with a "msi-map"
* property.
*
* Returns: the MSI domain for this device (or NULL on failure)
*/
struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 rid)
struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id,
u32 bus_token)
{
struct device_node *np = NULL;
__of_msi_map_rid(dev, &np, rid);
return irq_find_matching_host(np, DOMAIN_BUS_PCI_MSI);
__of_msi_map_rid(dev, &np, id);
return irq_find_matching_host(np, bus_token);
}
/**