diff mbox

[-next] mmc: sdhci-bcm-kona: fix error return code in sdhci_bcm_kona_probe()

Message ID 1469722664-15136-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun July 28, 2016, 4:17 p.m. UTC
In clk_set_rate() or clk_prepare_enable() error handling case, the
error return code ret is not set, so sdhci_bcm_kona_probe() return
0 in those error cases.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/mmc/host/sdhci-bcm-kona.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


--
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

Comments

Ray Jui July 28, 2016, 4:45 p.m. UTC | #1
Hi Wei,

On 7/28/2016 9:17 AM, Wei Yongjun wrote:
> In clk_set_rate() or clk_prepare_enable() error handling case, the
> error return code ret is not set, so sdhci_bcm_kona_probe() return
> 0 in those error cases.
>
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> ---
>  drivers/mmc/host/sdhci-bcm-kona.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
> index e5c634b..51dd2fd 100644
> --- a/drivers/mmc/host/sdhci-bcm-kona.c
> +++ b/drivers/mmc/host/sdhci-bcm-kona.c
> @@ -253,12 +253,14 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
>  		goto err_pltfm_free;
>  	}
>
> -	if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) {
> +	ret = clk_set_rate(pltfm_priv->clk, host->mmc->f_max);
> +	if (ret) {
>  		dev_err(dev, "Failed to set rate core clock\n");
>  		goto err_pltfm_free;
>  	}
>
> -	if (clk_prepare_enable(pltfm_priv->clk) != 0) {
> +	ret = clk_prepare_enable(pltfm_priv->clk);
> +	if (ret) {
>  		dev_err(dev, "Failed to enable core clock\n");
>  		goto err_pltfm_free;
>  	}
>

The above change looks good to me, thanks!

Acked-by: Ray Jui <ray.jui@broadcom.com>
--
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
Adrian Hunter Aug. 18, 2016, 6:59 a.m. UTC | #2
On 28/07/16 19:45, Ray Jui wrote:
> Hi Wei,
> 
> On 7/28/2016 9:17 AM, Wei Yongjun wrote:
>> In clk_set_rate() or clk_prepare_enable() error handling case, the
>> error return code ret is not set, so sdhci_bcm_kona_probe() return
>> 0 in those error cases.
>>
>> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
>> ---
>>  drivers/mmc/host/sdhci-bcm-kona.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-bcm-kona.c
>> b/drivers/mmc/host/sdhci-bcm-kona.c
>> index e5c634b..51dd2fd 100644
>> --- a/drivers/mmc/host/sdhci-bcm-kona.c
>> +++ b/drivers/mmc/host/sdhci-bcm-kona.c
>> @@ -253,12 +253,14 @@ static int sdhci_bcm_kona_probe(struct
>> platform_device *pdev)
>>          goto err_pltfm_free;
>>      }
>>
>> -    if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) {
>> +    ret = clk_set_rate(pltfm_priv->clk, host->mmc->f_max);
>> +    if (ret) {
>>          dev_err(dev, "Failed to set rate core clock\n");
>>          goto err_pltfm_free;
>>      }
>>
>> -    if (clk_prepare_enable(pltfm_priv->clk) != 0) {
>> +    ret = clk_prepare_enable(pltfm_priv->clk);
>> +    if (ret) {
>>          dev_err(dev, "Failed to enable core clock\n");
>>          goto err_pltfm_free;
>>      }
>>
> 
> The above change looks good to me, thanks!
> 
> Acked-by: Ray Jui <ray.jui@broadcom.com>
> 

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

--
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
Ulf Hansson Aug. 22, 2016, 1:39 p.m. UTC | #3
On 28 July 2016 at 18:17, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> In clk_set_rate() or clk_prepare_enable() error handling case, the
> error return code ret is not set, so sdhci_bcm_kona_probe() return
> 0 in those error cases.
>
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-bcm-kona.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
> index e5c634b..51dd2fd 100644
> --- a/drivers/mmc/host/sdhci-bcm-kona.c
> +++ b/drivers/mmc/host/sdhci-bcm-kona.c
> @@ -253,12 +253,14 @@ static int sdhci_bcm_kona_probe(struct platform_device *pdev)
>                 goto err_pltfm_free;
>         }
>
> -       if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) {
> +       ret = clk_set_rate(pltfm_priv->clk, host->mmc->f_max);
> +       if (ret) {
>                 dev_err(dev, "Failed to set rate core clock\n");
>                 goto err_pltfm_free;
>         }
>
> -       if (clk_prepare_enable(pltfm_priv->clk) != 0) {
> +       ret = clk_prepare_enable(pltfm_priv->clk);
> +       if (ret) {
>                 dev_err(dev, "Failed to enable core clock\n");
>                 goto err_pltfm_free;
>         }
>
--
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 mbox

Patch

diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c
index e5c634b..51dd2fd 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -253,12 +253,14 @@  static int sdhci_bcm_kona_probe(struct platform_device *pdev)
 		goto err_pltfm_free;
 	}
 
-	if (clk_set_rate(pltfm_priv->clk, host->mmc->f_max) != 0) {
+	ret = clk_set_rate(pltfm_priv->clk, host->mmc->f_max);
+	if (ret) {
 		dev_err(dev, "Failed to set rate core clock\n");
 		goto err_pltfm_free;
 	}
 
-	if (clk_prepare_enable(pltfm_priv->clk) != 0) {
+	ret = clk_prepare_enable(pltfm_priv->clk);
+	if (ret) {
 		dev_err(dev, "Failed to enable core clock\n");
 		goto err_pltfm_free;
 	}