Skip to content

Commit a063158

Browse files
okiasjoergroedel
authored andcommitted
iommu/msm: Simplify with dev_err_probe()
Use the dev_err_probe() helper to simplify error handling during probe. This also handle scenario, when EDEFER is returned and useless error is printed. Fixes warnings as: msm_iommu 7500000.iommu: could not get smmu_pclk Signed-off-by: David Heidelberg <david@ixit.cz> Link: https://lore.kernel.org/r/20220206202945.465195-1-david@ixit.cz Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 6b813e0 commit a063158

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

drivers/iommu/msm_iommu.c

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -710,36 +710,32 @@ static int msm_iommu_probe(struct platform_device *pdev)
710710
INIT_LIST_HEAD(&iommu->ctx_list);
711711

712712
iommu->pclk = devm_clk_get(iommu->dev, "smmu_pclk");
713-
if (IS_ERR(iommu->pclk)) {
714-
dev_err(iommu->dev, "could not get smmu_pclk\n");
715-
return PTR_ERR(iommu->pclk);
716-
}
713+
if (IS_ERR(iommu->pclk))
714+
return dev_err_probe(iommu->dev, PTR_ERR(iommu->pclk),
715+
"could not get smmu_pclk\n");
717716

718717
ret = clk_prepare(iommu->pclk);
719-
if (ret) {
720-
dev_err(iommu->dev, "could not prepare smmu_pclk\n");
721-
return ret;
722-
}
718+
if (ret)
719+
return dev_err_probe(iommu->dev, ret,
720+
"could not prepare smmu_pclk\n");
723721

724722
iommu->clk = devm_clk_get(iommu->dev, "iommu_clk");
725723
if (IS_ERR(iommu->clk)) {
726-
dev_err(iommu->dev, "could not get iommu_clk\n");
727724
clk_unprepare(iommu->pclk);
728-
return PTR_ERR(iommu->clk);
725+
return dev_err_probe(iommu->dev, PTR_ERR(iommu->clk),
726+
"could not get iommu_clk\n");
729727
}
730728

731729
ret = clk_prepare(iommu->clk);
732730
if (ret) {
733-
dev_err(iommu->dev, "could not prepare iommu_clk\n");
734731
clk_unprepare(iommu->pclk);
735-
return ret;
732+
return dev_err_probe(iommu->dev, ret, "could not prepare iommu_clk\n");
736733
}
737734

738735
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
739736
iommu->base = devm_ioremap_resource(iommu->dev, r);
740737
if (IS_ERR(iommu->base)) {
741-
dev_err(iommu->dev, "could not get iommu base\n");
742-
ret = PTR_ERR(iommu->base);
738+
ret = dev_err_probe(iommu->dev, PTR_ERR(iommu->base), "could not get iommu base\n");
743739
goto fail;
744740
}
745741
ioaddr = r->start;

0 commit comments

Comments
 (0)