]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ACPI: scan: Move misleading comment to acpi_dma_configure_id()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 25 Mar 2024 12:33:01 +0000 (14:33 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 4 Apr 2024 19:19:02 +0000 (21:19 +0200)
The acpi_iommu_configure_id() implementation has a misleading comment
since after it the flow does something different to what it states.
Move the commit to the caller and with that unshadow the error code
inside acpi_iommu_configure_id().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c

index dc625653b19888e00f412a6ca0e209f134fa2d3f..e64e1ec626b361fda6221b7a696c562d67a531ba 100644 (file)
@@ -1625,12 +1625,11 @@ static int acpi_iommu_configure_id(struct device *dev, const u32 *id_in)
        if (!err && dev->bus)
                err = iommu_probe_device(dev);
 
-       /* Ignore all other errors apart from EPROBE_DEFER */
-       if (err == -EPROBE_DEFER) {
+       if (err == -EPROBE_DEFER)
                return err;
-       } else if (err) {
+       if (err) {
                dev_dbg(dev, "Adding to IOMMU failed: %d\n", err);
-               return -ENODEV;
+               return err;
        }
        if (!acpi_iommu_fwspec_ops(dev))
                return -ENODEV;
@@ -1671,13 +1670,14 @@ int acpi_dma_configure_id(struct device *dev, enum dev_dma_attr attr,
 
        acpi_arch_dma_setup(dev);
 
+       /* Ignore all other errors apart from EPROBE_DEFER */
        ret = acpi_iommu_configure_id(dev, input_id);
        if (ret == -EPROBE_DEFER)
                return -EPROBE_DEFER;
 
        /*
         * Historically this routine doesn't fail driver probing due to errors
-        * in acpi_iommu_configure_id()
+        * in acpi_iommu_configure_id().
         */
 
        arch_setup_dma_ops(dev, 0, U64_MAX, attr == DEV_DMA_COHERENT);