linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: host: tmio: drop superfluous exit path
@ 2017-01-06  8:38 Wolfram Sang
  2017-01-06  8:51 ` Simon Horman
  2017-01-12 12:00 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2017-01-06  8:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang

The probe exit path on error does nothing since commit 94b110aff8679b
("mmc: tmio: add tmio_mmc_host_alloc/free()"), so we can bail out
immediately.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/tmio_mmc_pio.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index d0d1743b1c002b..2e2df63ce92658 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1151,7 +1151,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
 
 	ret = mmc_of_parse(mmc);
 	if (ret < 0)
-		goto host_free;
+		return ret;
 
 	_host->pdata = pdata;
 	platform_set_drvdata(pdev, mmc);
@@ -1161,14 +1161,12 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
 
 	ret = tmio_mmc_init_ocr(_host);
 	if (ret < 0)
-		goto host_free;
+		return ret;
 
 	_host->ctl = devm_ioremap(&pdev->dev,
 				  res_ctl->start, resource_size(res_ctl));
-	if (!_host->ctl) {
-		ret = -ENOMEM;
-		goto host_free;
-	}
+	if (!_host->ctl)
+		return -ENOMEM;
 
 	tmio_mmc_ops.card_busy = _host->card_busy;
 	tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch;
@@ -1206,10 +1204,8 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
 	 * Check the sanity of mmc->f_min to prevent tmio_mmc_set_clock() from
 	 * looping forever...
 	 */
-	if (mmc->f_min == 0) {
-		ret = -EINVAL;
-		goto host_free;
-	}
+	if (mmc->f_min == 0)
+		return -EINVAL;
 
 	/*
 	 * While using internal tmio hardware logic for card detection, we need
@@ -1274,10 +1270,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
 	}
 
 	return 0;
-
-host_free:
-
-	return ret;
 }
 EXPORT_SYMBOL(tmio_mmc_host_probe);
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: host: tmio: drop superfluous exit path
  2017-01-06  8:38 [PATCH] mmc: host: tmio: drop superfluous exit path Wolfram Sang
@ 2017-01-06  8:51 ` Simon Horman
  2017-01-12 12:00 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2017-01-06  8:51 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, linux-renesas-soc

On Fri, Jan 06, 2017 at 09:38:33AM +0100, Wolfram Sang wrote:
> The probe exit path on error does nothing since commit 94b110aff8679b
> ("mmc: tmio: add tmio_mmc_host_alloc/free()"), so we can bail out
> immediately.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: host: tmio: drop superfluous exit path
  2017-01-06  8:38 [PATCH] mmc: host: tmio: drop superfluous exit path Wolfram Sang
  2017-01-06  8:51 ` Simon Horman
@ 2017-01-12 12:00 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2017-01-12 12:00 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc@vger.kernel.org, Linux-Renesas

On 6 January 2017 at 09:38, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> The probe exit path on error does nothing since commit 94b110aff8679b
> ("mmc: tmio: add tmio_mmc_host_alloc/free()"), so we can bail out
> immediately.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/tmio_mmc_pio.c | 20 ++++++--------------
>  1 file changed, 6 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index d0d1743b1c002b..2e2df63ce92658 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -1151,7 +1151,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
>
>         ret = mmc_of_parse(mmc);
>         if (ret < 0)
> -               goto host_free;
> +               return ret;
>
>         _host->pdata = pdata;
>         platform_set_drvdata(pdev, mmc);
> @@ -1161,14 +1161,12 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
>
>         ret = tmio_mmc_init_ocr(_host);
>         if (ret < 0)
> -               goto host_free;
> +               return ret;
>
>         _host->ctl = devm_ioremap(&pdev->dev,
>                                   res_ctl->start, resource_size(res_ctl));
> -       if (!_host->ctl) {
> -               ret = -ENOMEM;
> -               goto host_free;
> -       }
> +       if (!_host->ctl)
> +               return -ENOMEM;
>
>         tmio_mmc_ops.card_busy = _host->card_busy;
>         tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch;
> @@ -1206,10 +1204,8 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
>          * Check the sanity of mmc->f_min to prevent tmio_mmc_set_clock() from
>          * looping forever...
>          */
> -       if (mmc->f_min == 0) {
> -               ret = -EINVAL;
> -               goto host_free;
> -       }
> +       if (mmc->f_min == 0)
> +               return -EINVAL;
>
>         /*
>          * While using internal tmio hardware logic for card detection, we need
> @@ -1274,10 +1270,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
>         }
>
>         return 0;
> -
> -host_free:
> -
> -       return ret;
>  }
>  EXPORT_SYMBOL(tmio_mmc_host_probe);
>
> --
> 2.11.0
>
> --
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12 12:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-06  8:38 [PATCH] mmc: host: tmio: drop superfluous exit path Wolfram Sang
2017-01-06  8:51 ` Simon Horman
2017-01-12 12:00 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).