spi: spi-qcom-qspi: 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: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/b77aa0bbe82a580508e321a34da488b4b27966d0.1598594714.git.viresh.kumar@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
7d568edff5
commit
062cf7fc92
@ -143,7 +143,6 @@ struct qcom_qspi {
|
|||||||
struct qspi_xfer xfer;
|
struct qspi_xfer xfer;
|
||||||
struct icc_path *icc_path_cpu_to_qspi;
|
struct icc_path *icc_path_cpu_to_qspi;
|
||||||
struct opp_table *opp_table;
|
struct opp_table *opp_table;
|
||||||
bool has_opp_table;
|
|
||||||
unsigned long last_speed;
|
unsigned long last_speed;
|
||||||
/* Lock to protect data accessed by IRQs */
|
/* Lock to protect data accessed by IRQs */
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
@ -546,11 +545,9 @@ static int qcom_qspi_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
/* 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) {
|
||||||
ctrl->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");
|
||||||
goto exit_probe_master_put;
|
goto exit_probe_put_clkname;
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_use_autosuspend(dev);
|
pm_runtime_use_autosuspend(dev);
|
||||||
@ -562,8 +559,9 @@ static int qcom_qspi_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
if (ctrl->has_opp_table)
|
|
||||||
dev_pm_opp_of_remove_table(&pdev->dev);
|
dev_pm_opp_of_remove_table(&pdev->dev);
|
||||||
|
|
||||||
|
exit_probe_put_clkname:
|
||||||
dev_pm_opp_put_clkname(ctrl->opp_table);
|
dev_pm_opp_put_clkname(ctrl->opp_table);
|
||||||
|
|
||||||
exit_probe_master_put:
|
exit_probe_master_put:
|
||||||
@ -581,7 +579,6 @@ static int qcom_qspi_remove(struct platform_device *pdev)
|
|||||||
spi_unregister_master(master);
|
spi_unregister_master(master);
|
||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
if (ctrl->has_opp_table)
|
|
||||||
dev_pm_opp_of_remove_table(&pdev->dev);
|
dev_pm_opp_of_remove_table(&pdev->dev);
|
||||||
dev_pm_opp_put_clkname(ctrl->opp_table);
|
dev_pm_opp_put_clkname(ctrl->opp_table);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user