Skip to content

Commit 78596b5

Browse files
rmurphy-armwilldeacon
authored andcommitted
ACPI: Retire acpi_iommu_fwspec_ops()
Now that iommu_fwspec_init() can signal for probe deferral directly, acpi_iommu_fwspec_ops() is unneeded and can be cleaned up. Acked-by: Rafael J. Wysocki <[email protected]> Tested-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/011e39e275aba3ad451c5a1965ca8ddf20ed36c2.1719919669.git.robin.murphy@arm.com Signed-off-by: Will Deacon <[email protected]>
1 parent 3f7c320 commit 78596b5

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

drivers/acpi/scan.c

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,26 +1588,14 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id,
15881588
return iommu_fwspec_add_ids(dev, &id, 1);
15891589
}
15901590

1591-
static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)
1592-
{
1593-
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
1594-
1595-
return fwspec ? fwspec->ops : NULL;
1596-
}
1597-
15981591
static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
15991592
{
16001593
int err;
1601-
const struct iommu_ops *ops;
16021594

16031595
/* Serialise to make dev->iommu stable under our potential fwspec */
16041596
mutex_lock(&iommu_probe_device_lock);
1605-
/*
1606-
* If we already translated the fwspec there is nothing left to do,
1607-
* return the iommu_ops.
1608-
*/
1609-
ops = acpi_iommu_fwspec_ops(dev);
1610-
if (ops) {
1597+
/* If we already translated the fwspec there is nothing left to do */
1598+
if (dev_iommu_fwspec_get(dev)) {
16111599
mutex_unlock(&iommu_probe_device_lock);
16121600
return 0;
16131601
}
@@ -1624,15 +1612,7 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
16241612
if (!err && dev->bus)
16251613
err = iommu_probe_device(dev);
16261614

1627-
if (err == -EPROBE_DEFER)
1628-
return err;
1629-
if (err) {
1630-
dev_dbg(dev, "Adding to IOMMU failed: %d\n", err);
1631-
return err;
1632-
}
1633-
if (!acpi_iommu_fwspec_ops(dev))
1634-
return -ENODEV;
1635-
return 0;
1615+
return err;
16361616
}
16371617

16381618
#else /* !CONFIG_IOMMU_API */
@@ -1672,6 +1652,8 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
16721652
ret = acpi_iommu_configure_id(dev, input_id);
16731653
if (ret == -EPROBE_DEFER)
16741654
return -EPROBE_DEFER;
1655+
if (ret)
1656+
dev_dbg(dev, "Adding to IOMMU failed: %d\n", ret);
16751657

16761658
arch_setup_dma_ops(dev, attr == DEV_DMA_COHERENT);
16771659

0 commit comments

Comments
 (0)