public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error
@ 2015-10-14 20:53 Sergei Shtylyov
  2015-10-16 13:07 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2015-10-14 20:53 UTC (permalink / raw)
  To: ulf.hansson, linux-mmc; +Cc: linux-kernel

There's little sense in releasing the host on mmc_add_card() error
immediately after reclaiming  it, so  reclaim the host  only in case
of success.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
The patch is against Ulf Hansson's 'mmc.git' repo's 'next' branch.

 drivers/mmc/core/mmc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: mmc/drivers/mmc/core/mmc.c
===================================================================
--- mmc.orig/drivers/mmc/core/mmc.c
+++ mmc/drivers/mmc/core/mmc.c
@@ -2009,14 +2009,13 @@ int mmc_attach_mmc(struct mmc_host *host
 
 	mmc_release_host(host);
 	err = mmc_add_card(host->card);
-	mmc_claim_host(host);
 	if (err)
 		goto remove_card;
 
+	mmc_claim_host(host);
 	return 0;
 
 remove_card:
-	mmc_release_host(host);
 	mmc_remove_card(host->card);
 	mmc_claim_host(host);
 	host->card = NULL;

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

* Re: [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error
  2015-10-14 20:53 [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error Sergei Shtylyov
@ 2015-10-16 13:07 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-10-16 13:07 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-mmc, linux-kernel@vger.kernel.org

On 14 October 2015 at 22:53, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> There's little sense in releasing the host on mmc_add_card() error
> immediately after reclaiming  it, so  reclaim the host  only in case
> of success.
>
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Thanks, applied patch 1 and patch 2 (squashed them) for next.

Kind regards
Uffe

>
> ---
> The patch is against Ulf Hansson's 'mmc.git' repo's 'next' branch.
>
>  drivers/mmc/core/mmc.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: mmc/drivers/mmc/core/mmc.c
> ===================================================================
> --- mmc.orig/drivers/mmc/core/mmc.c
> +++ mmc/drivers/mmc/core/mmc.c
> @@ -2009,14 +2009,13 @@ int mmc_attach_mmc(struct mmc_host *host
>
>         mmc_release_host(host);
>         err = mmc_add_card(host->card);
> -       mmc_claim_host(host);
>         if (err)
>                 goto remove_card;
>
> +       mmc_claim_host(host);
>         return 0;
>
>  remove_card:
> -       mmc_release_host(host);
>         mmc_remove_card(host->card);
>         mmc_claim_host(host);
>         host->card = NULL;
>

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

end of thread, other threads:[~2015-10-16 13:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14 20:53 [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error Sergei Shtylyov
2015-10-16 13:07 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox