diff mbox series

[v1,6/7] ACPI: scan: Use standard error checking pattern

Message ID 20240325123444.3031851-7-andriy.shevchenko@linux.intel.com (mailing list archive)
State Mainlined, archived
Headers show
Series ACPI: scan: A few ad-hoc cleanups | expand

Commit Message

Andy Shevchenko March 25, 2024, 12:33 p.m. UTC
Check for an error and return it as it's the usual way to handle this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/scan.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index b2785a036a68..45f7ec3b6548 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1579,12 +1579,13 @@  int acpi_iommu_fwspec_init(struct device *dev, u32 id,
 			   struct fwnode_handle *fwnode,
 			   const struct iommu_ops *ops)
 {
-	int ret = iommu_fwspec_init(dev, fwnode, ops);
+	int ret;
 
-	if (!ret)
-		ret = iommu_fwspec_add_ids(dev, &id, 1);
+	ret = iommu_fwspec_init(dev, fwnode, ops);
+	if (ret)
+		return ret;
 
-	return ret;
+	return iommu_fwspec_add_ids(dev, &id, 1);
 }
 
 static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)