Skip to content

Commit 065afdc

Browse files
committed
iommu/arm-smmu-v3: Use msi_get_virq()
Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Robin Murphy <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8484567 commit 065afdc

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,6 @@ static void arm_smmu_write_msi_msg(struct msi_desc *desc, struct msi_msg *msg)
31543154

31553155
static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
31563156
{
3157-
struct msi_desc *desc;
31583157
int ret, nvec = ARM_SMMU_MAX_MSIS;
31593158
struct device *dev = smmu->dev;
31603159

@@ -3182,21 +3181,9 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
31823181
return;
31833182
}
31843183

3185-
for_each_msi_entry(desc, dev) {
3186-
switch (desc->msi_index) {
3187-
case EVTQ_MSI_INDEX:
3188-
smmu->evtq.q.irq = desc->irq;
3189-
break;
3190-
case GERROR_MSI_INDEX:
3191-
smmu->gerr_irq = desc->irq;
3192-
break;
3193-
case PRIQ_MSI_INDEX:
3194-
smmu->priq.q.irq = desc->irq;
3195-
break;
3196-
default: /* Unknown */
3197-
continue;
3198-
}
3199-
}
3184+
smmu->evtq.q.irq = msi_get_virq(dev, EVTQ_MSI_INDEX);
3185+
smmu->gerr_irq = msi_get_virq(dev, GERROR_MSI_INDEX);
3186+
smmu->priq.q.irq = msi_get_virq(dev, PRIQ_MSI_INDEX);
32003187

32013188
/* Add callback to free MSIs on teardown */
32023189
devm_add_action(dev, arm_smmu_free_msis, dev);

0 commit comments

Comments
 (0)