Commit 78596b5c authored by Robin Murphy's avatar Robin Murphy Committed by Will Deacon

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/011e39e275aba3ad451c5a1965ca8ddf20ed36c2.1719919669.git.robin.murphy@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 3f7c3209
...@@ -1588,26 +1588,14 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id, ...@@ -1588,26 +1588,14 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id,
return iommu_fwspec_add_ids(dev, &id, 1); return iommu_fwspec_add_ids(dev, &id, 1);
} }
static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)
{
struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
return fwspec ? fwspec->ops : NULL;
}
static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in) static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
{ {
int err; int err;
const struct iommu_ops *ops;
/* Serialise to make dev->iommu stable under our potential fwspec */ /* Serialise to make dev->iommu stable under our potential fwspec */
mutex_lock(&iommu_probe_device_lock); mutex_lock(&iommu_probe_device_lock);
/* /* If we already translated the fwspec there is nothing left to do */
* If we already translated the fwspec there is nothing left to do, if (dev_iommu_fwspec_get(dev)) {
* return the iommu_ops.
*/
ops = acpi_iommu_fwspec_ops(dev);
if (ops) {
mutex_unlock(&iommu_probe_device_lock); mutex_unlock(&iommu_probe_device_lock);
return 0; return 0;
} }
...@@ -1624,15 +1612,7 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in) ...@@ -1624,15 +1612,7 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
if (!err && dev->bus) if (!err && dev->bus)
err = iommu_probe_device(dev); err = iommu_probe_device(dev);
if (err == -EPROBE_DEFER) return err;
return err;
if (err) {
dev_dbg(dev, "Adding to IOMMU failed: %d\n", err);
return err;
}
if (!acpi_iommu_fwspec_ops(dev))
return -ENODEV;
return 0;
} }
#else /* !CONFIG_IOMMU_API */ #else /* !CONFIG_IOMMU_API */
...@@ -1672,6 +1652,8 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr, ...@@ -1672,6 +1652,8 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
ret = acpi_iommu_configure_id(dev, input_id); ret = acpi_iommu_configure_id(dev, input_id);
if (ret == -EPROBE_DEFER) if (ret == -EPROBE_DEFER)
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (ret)
dev_dbg(dev, "Adding to IOMMU failed: %d\n", ret);
arch_setup_dma_ops(dev, attr == DEV_DMA_COHERENT); arch_setup_dma_ops(dev, attr == DEV_DMA_COHERENT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment