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")
Change-Id: I2ffed2cf23db0632c47f667a4b35584c4d181b7a
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>
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/canonical/linux-noble/+/3435439
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
This commit is contained in:
committed by
Ashish Mhetre
parent
3c1a5006e3
commit
b9be69606e
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user