Skip to content

Commit 602401e

Browse files
andy-shevrafaeljw
authored andcommitted
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>
1 parent e80d412 commit 602401e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/acpi/scan.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,12 +1581,13 @@ int acpi_iommu_fwspec_init(struct device *dev, u32 id,
15811581
struct fwnode_handle *fwnode,
15821582
const struct iommu_ops *ops)
15831583
{
1584-
int ret = iommu_fwspec_init(dev, fwnode, ops);
1584+
int ret;
15851585

1586-
if (!ret)
1587-
ret = iommu_fwspec_add_ids(dev, &id, 1);
1586+
ret = iommu_fwspec_init(dev, fwnode, ops);
1587+
if (ret)
1588+
return ret;
15881589

1589-
return ret;
1590+
return iommu_fwspec_add_ids(dev, &id, 1);
15901591
}
15911592

15921593
static inline const struct iommu_ops *acpi_iommu_fwspec_ops(struct device *dev)

0 commit comments

Comments
 (0)