Commit 7d568edf authored by Viresh Kumar's avatar Viresh Kumar Committed by Mark Brown

spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table()

dev_pm_opp_of_remove_table() doesn't report any errors when it fails to
find the OPP table with error -ENODEV (i.e. OPP table not present for
the device). And we can call dev_pm_opp_of_remove_table()
unconditionally here.

While at it, create a new label and put clkname on errors.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/ea0864d41277e61fa31d304fbd4cf9af6b314269.1598594714.git.viresh.kumar@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f4d51dff
...@@ -613,11 +613,9 @@ static int spi_geni_probe(struct platform_device *pdev) ...@@ -613,11 +613,9 @@ static int spi_geni_probe(struct platform_device *pdev)
return PTR_ERR(mas->se.opp_table); return PTR_ERR(mas->se.opp_table);
/* OPP table is optional */ /* OPP table is optional */
ret = dev_pm_opp_of_add_table(&pdev->dev); ret = dev_pm_opp_of_add_table(&pdev->dev);
if (!ret) { if (ret && ret != -ENODEV) {
mas->se.has_opp_table = true;
} else if (ret != -ENODEV) {
dev_err(&pdev->dev, "invalid OPP table in device tree\n"); dev_err(&pdev->dev, "invalid OPP table in device tree\n");
return ret; goto put_clkname;
} }
spi->bus_num = -1; spi->bus_num = -1;
...@@ -669,8 +667,8 @@ static int spi_geni_probe(struct platform_device *pdev) ...@@ -669,8 +667,8 @@ static int spi_geni_probe(struct platform_device *pdev)
spi_geni_probe_runtime_disable: spi_geni_probe_runtime_disable:
pm_runtime_disable(dev); pm_runtime_disable(dev);
spi_master_put(spi); spi_master_put(spi);
if (mas->se.has_opp_table)
dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_of_remove_table(&pdev->dev);
put_clkname:
dev_pm_opp_put_clkname(mas->se.opp_table); dev_pm_opp_put_clkname(mas->se.opp_table);
return ret; return ret;
} }
...@@ -685,7 +683,6 @@ static int spi_geni_remove(struct platform_device *pdev) ...@@ -685,7 +683,6 @@ static int spi_geni_remove(struct platform_device *pdev)
free_irq(mas->irq, spi); free_irq(mas->irq, spi);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
if (mas->se.has_opp_table)
dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_of_remove_table(&pdev->dev);
dev_pm_opp_put_clkname(mas->se.opp_table); dev_pm_opp_put_clkname(mas->se.opp_table);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment