From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
acpica-devel@lists.linux.dev
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>
Subject: [PATCH v1 5/7] ACPI: scan: Move misleading comment to acpi_dma_configure_id()
Date: Mon, 25 Mar 2024 14:33:01 +0200 [thread overview]
Message-ID: <20240325123444.3031851-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240325123444.3031851-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/acpi/scan.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index f5581d3701f1..b2785a036a68 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1623,12 +1623,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;
@@ -1669,13 +1668,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);
--
2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-03-25 12:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 12:32 [PATCH v1 0/7] ACPI: scan: A few ad-hoc cleanups Andy Shevchenko
2024-03-25 12:32 ` [PATCH v1 1/7] ACPI: bus: Make container_of() no-op where it makes sense Andy Shevchenko
2024-03-25 12:32 ` [PATCH v1 2/7] ACPI: bus: Don't use "proxy" headers Andy Shevchenko
2024-03-25 12:32 ` [PATCH v1 3/7] ACPI: scan: Replace infinite for-loop with finite while-loop Andy Shevchenko
2024-04-04 19:22 ` Rafael J. Wysocki
2024-04-04 19:26 ` Andy Shevchenko
2024-03-25 12:33 ` [PATCH v1 4/7] ACPI: scan: Use list_first_entry_or_null() in acpi_device_hid() Andy Shevchenko
2024-03-25 12:33 ` Andy Shevchenko [this message]
2024-03-25 12:33 ` [PATCH v1 6/7] ACPI: scan: Use standard error checking pattern Andy Shevchenko
2024-03-25 12:33 ` [PATCH v1 7/7] ACPI: scan: Introduce typedef:s for struct acpi_hotplug_context members Andy Shevchenko
2024-03-27 5:50 ` [PATCH v1 0/7] ACPI: scan: A few ad-hoc cleanups Kuppuswamy Sathyanarayanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240325123444.3031851-6-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=acpica-devel@lists.linux.dev \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox