From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754518AbbJNUxL (ORCPT ); Wed, 14 Oct 2015 16:53:11 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:36542 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754199AbbJNUxG (ORCPT ); Wed, 14 Oct 2015 16:53:06 -0400 From: Sergei Shtylyov To: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: skip reclaiming host on mmc_add_card() error Date: Wed, 14 Oct 2015 23:53:03 +0300 Message-ID: <4835546.qgzOJFlmY8@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.1.8-100.fc21.x86_64; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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;