From patchwork Fri Dec 30 12:47:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 89352 Delivered-To: patches@linaro.org Received: by 10.140.20.101 with SMTP id 92csp6424839qgi; Fri, 30 Dec 2016 04:48:39 -0800 (PST) X-Received: by 10.46.32.76 with SMTP id g73mr17239410ljg.22.1483102119349; Fri, 30 Dec 2016 04:48:39 -0800 (PST) Return-Path: Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com. [2a00:1450:4010:c07::22f]) by mx.google.com with ESMTPS id l69si18530550lfe.331.2016.12.30.04.48.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Dec 2016 04:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22f as permitted sender) client-ip=2a00:1450:4010:c07::22f; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22f as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22f.google.com with SMTP id b14so236443196lfg.2 for ; Fri, 30 Dec 2016 04:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y6JIcwuRXuuybPKjAv53xYB9XLYF48vKfIUkDmaJQ7o=; b=A4Dt2L5LtJHdZbTM4Ki1qGIcwKFJZanuWEW8yDlMp/sIyXaQ+TyyQgXGysReh53qF/ l8yi2jaJ2PwwCKDZTtEBHW2yL9ugCrT2PxIuqGTvTA07yY/5+Du7bXUAvLbgbuluwBxn owg6mCOrEH8haB5aT50nmBNHzZ6V4pejEMQJQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y6JIcwuRXuuybPKjAv53xYB9XLYF48vKfIUkDmaJQ7o=; b=n2AYX+iIBHd60I3fuawGbbm8Rq4Fg+f/SKjuOzj7OUOWgWgnR0ZzPNeOLfVg1saIVm 6Zt+8QUsfhNoZPyzmh72EUTexOOtokghu3zqIgDK5M25aV9JKiK0GWgb7n94JT6pyt4f R4/BR9Rihlh03F2GBB1rHpsiyLChgD+6rpsPQXY5OzPazF5Y24pgUX8gjPd/sbb6euVC ME1Ac2DJYhMr7BUCy7WofRqEzJ2nswdYoIb6Uca+h7iY9H3NLckryjt4+ixhtFGnV0KL rPWHcEpeAs91MVtskwQOYB5L51CgxvORAdQRP73uLfOuoqgeMU6O/tsavAlpTWq5/5u/ +CZQ== X-Gm-Message-State: AIkVDXKVnIUB8I6wi598ohPeAH8N+qPjOSDRnn3ksikHZmdUyoRxlQYPVFbxzDck4/32jYxwX9w= X-Received: by 10.25.37.80 with SMTP id l77mr13450046lfl.152.1483102118936; Fri, 30 Dec 2016 04:48:38 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id a79sm7450069ljb.46.2016.12.30.04.48.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Dec 2016 04:48:37 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Linus Walleij Subject: [PATCH 18/21] mmc: vub300: Don't use mmc_card_present() when validating for inserted card Date: Fri, 30 Dec 2016 13:47:31 +0100 Message-Id: <1483102054-1752-19-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483102054-1752-1-git-send-email-ulf.hansson@linaro.org> References: <1483102054-1752-1-git-send-email-ulf.hansson@linaro.org> The mmc_card_present() function helps the mmc core to track an internal state of the card device. More importantly, it's not intended to be used by mmc host drivers to check for an inserted card. Therefore, let's stop using it and instead rely on checking for a valid pointer to a struct mmc_card, as it should be good enough. Signed-off-by: Ulf Hansson --- drivers/mmc/host/vub300.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.9.1 Reviewed-by: Linus Walleij diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index bb3e0d1..0f49aba 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c @@ -728,8 +728,7 @@ static void vub300_deadwork_thread(struct work_struct *work) */ } else if (vub300->card_present) { check_vub300_port_status(vub300); - } else if (vub300->mmc && vub300->mmc->card && - mmc_card_present(vub300->mmc->card)) { + } else if (vub300->mmc && vub300->mmc->card) { /* * the MMC core must not have responded * to the previous indication - lets @@ -1756,8 +1755,7 @@ static void vub300_cmndwork_thread(struct work_struct *work) int data_length; mutex_lock(&vub300->cmd_mutex); init_completion(&vub300->command_complete); - if (likely(vub300->vub_name[0]) || !vub300->mmc->card || - !mmc_card_present(vub300->mmc->card)) { + if (likely(vub300->vub_name[0]) || !vub300->mmc->card) { /* * the name of the EMPTY Pseudo firmware file * is used as a flag to indicate that the file