Re: [PATCH 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table()

From: Ulf Hansson
Date: Mon Aug 24 2020 - 05:51:51 EST


On Thu, 20 Aug 2020 at 12:44, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> 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.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/host/sdhci-msm.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> index 5a33389037cd..b7e47107a31a 100644
> --- a/drivers/mmc/host/sdhci-msm.c
> +++ b/drivers/mmc/host/sdhci-msm.c
> @@ -263,7 +263,6 @@ struct sdhci_msm_host {
> unsigned long clk_rate;
> struct mmc_host *mmc;
> struct opp_table *opp_table;
> - bool has_opp_table;
> bool use_14lpp_dll_reset;
> bool tuning_done;
> bool calibration_done;
> @@ -2285,9 +2284,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
>
> /* OPP table is optional */
> ret = dev_pm_opp_of_add_table(&pdev->dev);
> - if (!ret) {
> - msm_host->has_opp_table = true;
> - } else if (ret != -ENODEV) {
> + if (ret != -ENODEV) {
> dev_err(&pdev->dev, "Invalid OPP table in Device tree\n");
> goto opp_cleanup;
> }
> @@ -2453,8 +2450,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
> clk_bulk_disable_unprepare(ARRAY_SIZE(msm_host->bulk_clks),
> msm_host->bulk_clks);
> opp_cleanup:
> - if (msm_host->has_opp_table)
> - dev_pm_opp_of_remove_table(&pdev->dev);
> + dev_pm_opp_of_remove_table(&pdev->dev);
> dev_pm_opp_put_clkname(msm_host->opp_table);
> bus_clk_disable:
> if (!IS_ERR(msm_host->bus_clk))
> @@ -2474,8 +2470,7 @@ static int sdhci_msm_remove(struct platform_device *pdev)
>
> sdhci_remove_host(host, dead);
>
> - if (msm_host->has_opp_table)
> - dev_pm_opp_of_remove_table(&pdev->dev);
> + dev_pm_opp_of_remove_table(&pdev->dev);
> dev_pm_opp_put_clkname(msm_host->opp_table);
> pm_runtime_get_sync(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> --
> 2.25.0.rc1.19.g042ed3e048af
>