summaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-03-25 15:33:02 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-04-04 22:19:02 +0300
commit602401e32847f90c513df4a34bcac4dd6b02dd8d (patch)
treec60c2939a61e4c578e50770dc0ee0c11e5852d5f /drivers/acpi/scan.c
parente80d4122df9c707ebc9cfe20ab60be302fc9b833 (diff)
downloadlinux-602401e32847f90c513df4a34bcac4dd6b02dd8d.tar.xz
ACPI: scan: Use standard error checking pattern
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> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e64e1ec626b3..b9a33364e553 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1581,12 +1581,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)