From patchwork Fri Jan 13 13:14:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 91415 Delivered-To: patches@linaro.org Received: by 10.182.3.34 with SMTP id 2csp131285obz; Fri, 13 Jan 2017 05:15:15 -0800 (PST) X-Received: by 10.46.75.10 with SMTP id y10mr7589711lja.65.1484313315035; Fri, 13 Jan 2017 05:15:15 -0800 (PST) Return-Path: Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com. [2a00:1450:4010:c07::22b]) by mx.google.com with ESMTPS id t1si7879766lfd.12.2017.01.13.05.15.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 05:15:15 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22b as permitted sender) client-ip=2a00:1450:4010:c07::22b; 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::22b as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22b.google.com with SMTP id k86so37160101lfi.0 for ; Fri, 13 Jan 2017 05:15:14 -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=dW8BfbemTV4eJp1YptXqjE5EuFx2N0ht4E57bvC8f1w=; b=F3NU8oJASAAU0b6Vt2tbbmdn88nD2amLEyt863TpWIIHeuCSM0AWx+DRhEJYczSTVr dkIT7inaWGZ0lft+KInQdFw4hGzs8Jl3ew6EwrY6JPGr8caKnr4CbRh91SFTOaAGG2u/ /kqZY4hqnYewUWoUlIg4CAlPJoj/IPhpctXms= 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=dW8BfbemTV4eJp1YptXqjE5EuFx2N0ht4E57bvC8f1w=; b=QttsKtKy7XJoBz1Zok+KPOt4+QsCUm+Og4sZJNtxeYz7OQJ8wInw30B+J3CXLpx8Kf 4g0vMokBsnWR/FnMiAHnz9vT4zylPbhnYdksKng1ZKCivDibGhDNbUV/wz77lvYQpZ2r /BfkGykN087o18C0qzXoMEG+E9k22yXxRD5O7w3iahYZad1+AcKJX5KKn7bVEa18gOMd IjAF9eAhp/v1oOHKpZz+7pAOpfIHNf1z/nc5+pH6lY1LnC9l0e/QdhxMMdoWp74Xg70C sg0A30o/jPLohs2ZsoRiZu1XJmRAY+eCF2TA6S+vLrQ2BltCdnqeoSYNpThCbwDEON8c lemA== X-Gm-Message-State: AIkVDXKwlwYrnq0mZDTZH7Hpu/6WhSJPXBgWdVy5ZJOfpH0f/lAX9sTpq326W4936VwYF18R7Zw= X-Received: by 10.46.72.17 with SMTP id v17mr7132633lja.5.1484313314614; Fri, 13 Jan 2017 05:15:14 -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 l67sm2931452lfb.15.2017.01.13.05.15.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 05:15:13 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Linus Walleij Subject: [PATCH v3 12/15] mmc: vub300: Don't use mmc_card_present() when validating for inserted card Date: Fri, 13 Jan 2017 14:14:13 +0100 Message-Id: <1484313256-25993-13-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484313256-25993-1-git-send-email-ulf.hansson@linaro.org> References: <1484313256-25993-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 Reviewed-by: Linus Walleij --- drivers/mmc/host/vub300.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index 21ea776..c061e7c 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c @@ -726,8 +726,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 @@ -1754,8 +1753,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