Skip to content

Commit 2bcdd8f

Browse files
Lorenzo Pieralisictmarinas
authored andcommitted
of/irq: Make of_msi_map_rid() PCI bus agnostic
There is nothing PCI bus specific in the of_msi_map_rid() implementation other than the requester ID tag for the input ID space. Rename requester ID to a more generic ID so that the translation code can be used by all busses that require input/output ID translations. No functional change intended. Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rob Herring <[email protected]> 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]>
1 parent 6f881ab commit 2bcdd8f

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

drivers/of/irq.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -576,43 +576,43 @@ void __init of_irq_init(const struct of_device_id *matches)
576576
}
577577
}
578578

579-
static u32 __of_msi_map_rid(struct device *dev, struct device_node **np,
580-
u32 rid_in)
579+
static u32 __of_msi_map_id(struct device *dev, struct device_node **np,
580+
u32 id_in)
581581
{
582582
struct device *parent_dev;
583-
u32 rid_out = rid_in;
583+
u32 id_out = id_in;
584584

585585
/*
586586
* Walk up the device parent links looking for one with a
587587
* "msi-map" property.
588588
*/
589589
for (parent_dev = dev; parent_dev; parent_dev = parent_dev->parent)
590-
if (!of_map_id(parent_dev->of_node, rid_in, "msi-map",
591-
"msi-map-mask", np, &rid_out))
590+
if (!of_map_id(parent_dev->of_node, id_in, "msi-map",
591+
"msi-map-mask", np, &id_out))
592592
break;
593-
return rid_out;
593+
return id_out;
594594
}
595595

596596
/**
597-
* of_msi_map_rid - Map a MSI requester ID for a device.
597+
* of_msi_map_id - Map a MSI ID for a device.
598598
* @dev: device for which the mapping is to be done.
599599
* @msi_np: device node of the expected msi controller.
600-
* @rid_in: unmapped MSI requester ID for the device.
600+
* @id_in: unmapped MSI ID for the device.
601601
*
602602
* Walk up the device hierarchy looking for devices with a "msi-map"
603-
* property. If found, apply the mapping to @rid_in.
603+
* property. If found, apply the mapping to @id_in.
604604
*
605-
* Returns the mapped MSI requester ID.
605+
* Returns the mapped MSI ID.
606606
*/
607-
u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in)
607+
u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in)
608608
{
609-
return __of_msi_map_rid(dev, &msi_np, rid_in);
609+
return __of_msi_map_id(dev, &msi_np, id_in);
610610
}
611611

612612
/**
613613
* of_msi_map_get_device_domain - Use msi-map to find the relevant MSI domain
614614
* @dev: device for which the mapping is to be done.
615-
* @rid: Requester ID for the device.
615+
* @id: Device ID.
616616
* @bus_token: Bus token
617617
*
618618
* Walk up the device hierarchy looking for devices with a "msi-map"
@@ -625,7 +625,7 @@ struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id,
625625
{
626626
struct device_node *np = NULL;
627627

628-
__of_msi_map_rid(dev, &np, id);
628+
__of_msi_map_id(dev, &np, id);
629629
return irq_find_matching_host(np, bus_token);
630630
}
631631

drivers/pci/msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev)
15351535
pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid);
15361536

15371537
of_node = irq_domain_get_of_node(domain);
1538-
rid = of_node ? of_msi_map_rid(&pdev->dev, of_node, rid) :
1538+
rid = of_node ? of_msi_map_id(&pdev->dev, of_node, rid) :
15391539
iort_msi_map_id(&pdev->dev, rid);
15401540

15411541
return rid;

include/linux/of_irq.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
5555
u32 id,
5656
u32 bus_token);
5757
extern void of_msi_configure(struct device *dev, struct device_node *np);
58-
u32 of_msi_map_rid(struct device *dev, struct device_node *msi_np, u32 rid_in);
58+
u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in);
5959
#else
6060
static inline int of_irq_count(struct device_node *dev)
6161
{
@@ -93,10 +93,10 @@ static inline struct irq_domain *of_msi_map_get_device_domain(struct device *dev
9393
static inline void of_msi_configure(struct device *dev, struct device_node *np)
9494
{
9595
}
96-
static inline u32 of_msi_map_rid(struct device *dev,
97-
struct device_node *msi_np, u32 rid_in)
96+
static inline u32 of_msi_map_id(struct device *dev,
97+
struct device_node *msi_np, u32 id_in)
9898
{
99-
return rid_in;
99+
return id_in;
100100
}
101101
#endif
102102

0 commit comments

Comments
 (0)