Message ID | 1468547648-4458-1-git-send-email-jh80.chung@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
在 2016/7/15 9:54, Jaehoon Chung 写道: > If ciu/biu clock are NULL, clk_disable_unprepare should be just > returned. In clk_disable_unprepare(), already checked whether clk is > error or NULL. > > Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> That's a good catch. Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> > --- > drivers/mmc/host/dw_mmc.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c > index 2dfdc58..9fab5ed 100644 > --- a/drivers/mmc/host/dw_mmc.c > +++ b/drivers/mmc/host/dw_mmc.c > @@ -3184,12 +3184,10 @@ err_dmaunmap: > host->dma_ops->exit(host); > > err_clk_ciu: > - if (!IS_ERR(host->ciu_clk)) > - clk_disable_unprepare(host->ciu_clk); > + clk_disable_unprepare(host->ciu_clk); > > err_clk_biu: > - if (!IS_ERR(host->biu_clk)) > - clk_disable_unprepare(host->biu_clk); > + clk_disable_unprepare(host->biu_clk); > > return ret; > } > @@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host) > if (host->use_dma && host->dma_ops->exit) > host->dma_ops->exit(host); > > - if (!IS_ERR(host->ciu_clk)) > - clk_disable_unprepare(host->ciu_clk); > - > - if (!IS_ERR(host->biu_clk)) > - clk_disable_unprepare(host->biu_clk); > + clk_disable_unprepare(host->ciu_clk); > + clk_disable_unprepare(host->biu_clk); > } > EXPORT_SYMBOL(dw_mci_remove); > >
On 07/15/2016 11:07 AM, Shawn Lin wrote: > 在 2016/7/15 9:54, Jaehoon Chung 写道: >> If ciu/biu clock are NULL, clk_disable_unprepare should be just >> returned. In clk_disable_unprepare(), already checked whether clk is >> error or NULL. >> >> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> > > That's a good catch. > > Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Applied on my repository. Thanks! Best Regards, Jaehoon Chung > >> --- >> drivers/mmc/host/dw_mmc.c | 13 ++++--------- >> 1 file changed, 4 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c >> index 2dfdc58..9fab5ed 100644 >> --- a/drivers/mmc/host/dw_mmc.c >> +++ b/drivers/mmc/host/dw_mmc.c >> @@ -3184,12 +3184,10 @@ err_dmaunmap: >> host->dma_ops->exit(host); >> >> err_clk_ciu: >> - if (!IS_ERR(host->ciu_clk)) >> - clk_disable_unprepare(host->ciu_clk); >> + clk_disable_unprepare(host->ciu_clk); >> >> err_clk_biu: >> - if (!IS_ERR(host->biu_clk)) >> - clk_disable_unprepare(host->biu_clk); >> + clk_disable_unprepare(host->biu_clk); >> >> return ret; >> } >> @@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host) >> if (host->use_dma && host->dma_ops->exit) >> host->dma_ops->exit(host); >> >> - if (!IS_ERR(host->ciu_clk)) >> - clk_disable_unprepare(host->ciu_clk); >> - >> - if (!IS_ERR(host->biu_clk)) >> - clk_disable_unprepare(host->biu_clk); >> + clk_disable_unprepare(host->ciu_clk); >> + clk_disable_unprepare(host->biu_clk); >> } >> EXPORT_SYMBOL(dw_mci_remove); >> >> > > -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 2dfdc58..9fab5ed 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -3184,12 +3184,10 @@ err_dmaunmap: host->dma_ops->exit(host); err_clk_ciu: - if (!IS_ERR(host->ciu_clk)) - clk_disable_unprepare(host->ciu_clk); + clk_disable_unprepare(host->ciu_clk); err_clk_biu: - if (!IS_ERR(host->biu_clk)) - clk_disable_unprepare(host->biu_clk); + clk_disable_unprepare(host->biu_clk); return ret; } @@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host) if (host->use_dma && host->dma_ops->exit) host->dma_ops->exit(host); - if (!IS_ERR(host->ciu_clk)) - clk_disable_unprepare(host->ciu_clk); - - if (!IS_ERR(host->biu_clk)) - clk_disable_unprepare(host->biu_clk); + clk_disable_unprepare(host->ciu_clk); + clk_disable_unprepare(host->biu_clk); } EXPORT_SYMBOL(dw_mci_remove);
If ciu/biu clock are NULL, clk_disable_unprepare should be just returned. In clk_disable_unprepare(), already checked whether clk is error or NULL. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> --- drivers/mmc/host/dw_mmc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)