From patchwork Wed Jan 11 11:51:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 90858 Delivered-To: patches@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1081750qgi; Wed, 11 Jan 2017 03:52:00 -0800 (PST) X-Received: by 10.25.163.213 with SMTP id m204mr3269731lfe.77.1484135520071; Wed, 11 Jan 2017 03:52:00 -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 89si3374704lfv.15.2017.01.11.03.51.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jan 2017 03:52:00 -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 o140so80124115lff.3 for ; Wed, 11 Jan 2017 03:51:59 -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=fwn7rOjAAO3wn/zhfRNpIuc8865SMb2In6RcDzEoVnw=; b=PzF+yzlvPIZcER7lZlzJ7lljNAiBD11+IlhXHwR3RRyBChn2ds8OHx9QoruRzyk+4N 4qucRViUAf09dI5f/iYdWg2CEzJy6jos7oxRhaB9CR/2ULcURuHx1dud0YCGYWyPpgp5 0VkLzvSeptIjVcnmEEQKNs0ib+GTc+GwLML5w= 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=fwn7rOjAAO3wn/zhfRNpIuc8865SMb2In6RcDzEoVnw=; b=fnSiXMknf2EfMottdb7KpGaZkiyT7igXhgnsiqL79XlcjzMgAtTsnHLe23+hTr/hAp H0fYIng2Ck26p87iYgc+mwQGKbt4RIdvu5uWh8fu8X6dInUzPoLgHb//8S+DXDyGN8Ft WSiVXI2Iami8cXSfzhZowl/wkrNQOLoLGAQpi2uQOUyBtrEQQncZY22Tuu1WesEjbNmX g2VK+qyYf2BH/qU8X2QmplfjeNxM8+3ijLKSBfu29q3/9VNfR+7vl1SmYVyNHoA1ACLc IgU6djriNW6vw4gM7p7VklvsHh8z4WmbGd8WdrcmARvhv3SMYfJVP41WSxbLQucg3RmJ ms2Q== X-Gm-Message-State: AIkVDXKUiPUlO3iWa54dMPKoItxXkIJVnBXpKV0Y62dFkzQDY/2KxZYnu8ZEr1VWrMhzBK1mhx4= X-Received: by 10.25.228.138 with SMTP id x10mr3120840lfi.55.1484135519564; Wed, 11 Jan 2017 03:51:59 -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 87sm958768lft.27.2017.01.11.03.51.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jan 2017 03:51:58 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Linus Walleij Subject: [PATCH v2 09/12] mmc: vub300: Don't use mmc_card_present() when validating for inserted card Date: Wed, 11 Jan 2017 12:51:15 +0100 Message-Id: <1484135478-2077-10-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484135478-2077-1-git-send-email-ulf.hansson@linaro.org> References: <1484135478-2077-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 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