[PATCH 2/2] mmc: sdhci-esdhc-imx: fix warning during module remove function

Shawn Guo shawn.guo at linaro.org
Mon Dec 23 22:16:09 EST 2013


On Tue, Dec 24, 2013 at 10:34:13AM +0800, Dong Aisheng wrote:
> > > @@ -1169,10 +1167,6 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
> > >  	pm_runtime_dont_use_autosuspend(&pdev->dev);
> > >  	pm_runtime_disable(&pdev->dev);
> > >  
> > > -	clk_disable_unprepare(imx_data->clk_per);
> > > -	clk_disable_unprepare(imx_data->clk_ipg);
> > > -	clk_disable_unprepare(imx_data->clk_ahb);
> > 
> > It's obviously a bad change to me.  We should definitely have these
> > clk_disable_unprepare() calls in sdhci_esdhc_imx_remove() to match the
> > clk_prepare_enable() calls in sdhci_esdhc_imx_probe().  Otherwise, at
> > least for !CONFIG_PM_RUNTIME build, it's broken.
> > 
> 
> How about add the !CONFIG_RUMTIME_PM precondition for these code to avoid
> break non runtime pm case?
> 
> #ifndef CONFIG_PM_RUNTIME
> 	clk_disable_unprepare(imx_data->clk_per);
> 	clk_disable_unprepare(imx_data->clk_ipg);
> 	clk_disable_unprepare(imx_data->clk_ahb);
> #endif

It's quite ugly.  But well, if we do not have anything better, we have
to live with it.

Shawn




More information about the linux-arm-kernel mailing list