Skip to content

Commit 086a3c4

Browse files
Dan Carpenterwilldeacon
authored andcommitted
iommu/tegra241-cmdqv: Fix ioremap() error handling in probe()
The ioremap() function doesn't return error pointers, it returns NULL on error so update the error handling. Also just return directly instead of calling iounmap() on the NULL pointer. Calling iounmap(NULL) doesn't cause a problem on ARM but on other architectures it can trigger a warning so it'a bad habbit. Fixes: 918eb5c ("iommu/arm-smmu-v3: Add in-kernel support for NVIDIA Tegra241 (Grace) CMDQV") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent db184a1 commit 086a3c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,9 +772,9 @@ __tegra241_cmdqv_probe(struct arm_smmu_device *smmu, struct resource *res,
772772
static_assert(offsetof(struct tegra241_cmdqv, smmu) == 0);
773773

774774
base = ioremap(res->start, resource_size(res));
775-
if (IS_ERR(base)) {
776-
dev_err(smmu->dev, "failed to ioremap: %ld\n", PTR_ERR(base));
777-
goto iounmap;
775+
if (!base) {
776+
dev_err(smmu->dev, "failed to ioremap\n");
777+
return NULL;
778778
}
779779

780780
regval = readl(base + TEGRA241_CMDQV_CONFIG);

0 commit comments

Comments
 (0)