diff options
author | 2024-03-25 14:33:02 +0200 | |
---|---|---|
committer | 2024-04-04 21:19:02 +0200 | |
commit | 602401e32847f90c513df4a34bcac4dd6b02dd8d (patch) | |
tree | c60c2939a61e4c578e50770dc0ee0c11e5852d5f | |
parent | ACPI: scan: Move misleading comment to acpi_dma_configure_id() (diff) | |
download | wireguard-linux-602401e32847f90c513df4a34bcac4dd6b02dd8d.tar.xz wireguard-linux-602401e32847f90c513df4a34bcac4dd6b02dd8d.zip |
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>
-rw-r--r-- | drivers/acpi/scan.c | 9 |
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) |