mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 14:43:16 +00:00
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>
This commit is contained in:
parent
6b813e0e48
commit
a063158b20
@ -710,36 +710,32 @@ static int msm_iommu_probe(struct platform_device *pdev)
|
|||||||
INIT_LIST_HEAD(&iommu->ctx_list);
|
INIT_LIST_HEAD(&iommu->ctx_list);
|
||||||
|
|
||||||
iommu->pclk = devm_clk_get(iommu->dev, "smmu_pclk");
|
iommu->pclk = devm_clk_get(iommu->dev, "smmu_pclk");
|
||||||
if (IS_ERR(iommu->pclk)) {
|
if (IS_ERR(iommu->pclk))
|
||||||
dev_err(iommu->dev, "could not get smmu_pclk\n");
|
return dev_err_probe(iommu->dev, PTR_ERR(iommu->pclk),
|
||||||
return PTR_ERR(iommu->pclk);
|
"could not get smmu_pclk\n");
|
||||||
}
|
|
||||||
|
|
||||||
ret = clk_prepare(iommu->pclk);
|
ret = clk_prepare(iommu->pclk);
|
||||||
if (ret) {
|
if (ret)
|
||||||
dev_err(iommu->dev, "could not prepare smmu_pclk\n");
|
return dev_err_probe(iommu->dev, ret,
|
||||||
return ret;
|
"could not prepare smmu_pclk\n");
|
||||||
}
|
|
||||||
|
|
||||||
iommu->clk = devm_clk_get(iommu->dev, "iommu_clk");
|
iommu->clk = devm_clk_get(iommu->dev, "iommu_clk");
|
||||||
if (IS_ERR(iommu->clk)) {
|
if (IS_ERR(iommu->clk)) {
|
||||||
dev_err(iommu->dev, "could not get iommu_clk\n");
|
|
||||||
clk_unprepare(iommu->pclk);
|
clk_unprepare(iommu->pclk);
|
||||||
return PTR_ERR(iommu->clk);
|
return dev_err_probe(iommu->dev, PTR_ERR(iommu->clk),
|
||||||
|
"could not get iommu_clk\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = clk_prepare(iommu->clk);
|
ret = clk_prepare(iommu->clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(iommu->dev, "could not prepare iommu_clk\n");
|
|
||||||
clk_unprepare(iommu->pclk);
|
clk_unprepare(iommu->pclk);
|
||||||
return ret;
|
return dev_err_probe(iommu->dev, ret, "could not prepare iommu_clk\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
iommu->base = devm_ioremap_resource(iommu->dev, r);
|
iommu->base = devm_ioremap_resource(iommu->dev, r);
|
||||||
if (IS_ERR(iommu->base)) {
|
if (IS_ERR(iommu->base)) {
|
||||||
dev_err(iommu->dev, "could not get iommu base\n");
|
ret = dev_err_probe(iommu->dev, PTR_ERR(iommu->base), "could not get iommu base\n");
|
||||||
ret = PTR_ERR(iommu->base);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
ioaddr = r->start;
|
ioaddr = r->start;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user