summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/arm
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-09-04 10:02:43 +0200
committerWill Deacon <will@kernel.org>2024-09-04 17:42:49 +0200
commit086a3c40ebd02a4ac38121cf909326407b2883bc (patch)
treedb31d9b172ad37c353aa09cd6babdcfcb4ad54f9 /drivers/iommu/arm
parentiommu/tegra241-cmdqv: Fix -Wformat-truncation warnings in lvcmdq_error_header (diff)
downloadlinux-086a3c40ebd02a4ac38121cf909326407b2883bc.tar.xz
linux-086a3c40ebd02a4ac38121cf909326407b2883bc.zip
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: 918eb5c856f6 ("iommu/arm-smmu-v3: Add in-kernel support for NVIDIA Tegra241 (Grace) CMDQV") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com> Link: https://lore.kernel.org/r/5a6c1e9a-0724-41b1-86d4-36335d3768ea@stanley.mountain Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/iommu/arm')
-rw-r--r--drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
index 03fd13c21dcc..240b54192177 100644
--- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
+++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
@@ -772,9 +772,9 @@ __tegra241_cmdqv_probe(struct arm_smmu_device *smmu, struct resource *res,
static_assert(offsetof(struct tegra241_cmdqv, smmu) == 0);
base = ioremap(res->start, resource_size(res));
- if (IS_ERR(base)) {
- dev_err(smmu->dev, "failed to ioremap: %ld\n", PTR_ERR(base));
- goto iounmap;
+ if (!base) {
+ dev_err(smmu->dev, "failed to ioremap\n");
+ return NULL;
}
regval = readl(base + TEGRA241_CMDQV_CONFIG);