From patchwork Fri Jan 29 04:06:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 8158381 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 12D109FE6C for ; Fri, 29 Jan 2016 04:06:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C027201F2 for ; Fri, 29 Jan 2016 04:06:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13B3F2035E for ; Fri, 29 Jan 2016 04:06:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752193AbcA2EGZ (ORCPT ); Thu, 28 Jan 2016 23:06:25 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:50318 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753272AbcA2EGT (ORCPT ); Thu, 28 Jan 2016 23:06:19 -0500 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O1P01O734QHD000@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Fri, 29 Jan 2016 13:06:17 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.114]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 7E.D3.04790.935EAA65; Fri, 29 Jan 2016 13:06:17 +0900 (KST) X-AuditID: cbfee691-f79766d0000012b6-66-56aae5397960 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 69.34.09068.935EAA65; Fri, 29 Jan 2016 13:06:17 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O1P00AR64QHJ370@mmp2.samsung.com>; Fri, 29 Jan 2016 13:06:17 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, sonic.zhang@analog.com, robert.jarzmik@free.fr, Jaehoon Chung Subject: [PATCH 01/12] mmc: core: use the defined function to check whether card is removable Date: Fri, 29 Jan 2016 13:06:00 +0900 Message-id: <1454040371-31625-2-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1454040371-31625-1-git-send-email-jh80.chung@samsung.com> References: <1454040371-31625-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsWyRsSkSNfy6aowg6M7jC1u/GpjtTjyv5/R YtYbYYs7W5vZLI6vDXdg9Xh11dGjf91nVo871/awefRtWcXo8XmTXABrFJdNSmpOZllqkb5d AlfGqxc97AUreSv6Pq5jaWD8zdXFyMkhIWAicfvNLSYIW0ziwr31bF2MXBxCAisYJQ5N+8kM U/R91htWiMQsRomdL16zgSSEBH4wSixaqg9iswnoSGz/dhxskoiArMTPPxfAapgFSiS23T4N 1MzBISwQL9E3Mw0kzCKgKvHg4VJGEJtXwE3i85Ej7BC75CROHpvMCmJzCrhLbNjzhgVilZvE wmcHWEBukBDoZpeYO+UKE8QgAYlvkw+xgMyXANq76QDUzZISB1fcYJnAKLyAkWEVo2hqQXJB cVJ6kalecWJucWleul5yfu4mRmAon/73bOIOxvsHrA8xCnAwKvHwPshcFSbEmlhWXJl7iNEU aMNEZinR5HxgxOSVxBsamxlZmJqYGhuZW5opifPqSP8MFhJITyxJzU5NLUgtii8qzUktPsTI xMEp1cBowsIxiaXBT+mlwtHlB49N/jk1cZW1RnrL7Ws3T919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Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In linux/mmc/host.h, mmc_card_is_removable() is already defined. There is no reason that it doesn't use. Signed-off-by: Jaehoon Chung --- drivers/mmc/core/core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index f95d41f..9da9b60 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2532,7 +2532,7 @@ int mmc_detect_card_removed(struct mmc_host *host) if (!card) return 1; - if (host->caps & MMC_CAP_NONREMOVABLE) + if (!mmc_card_is_removable(host)) return 0; ret = mmc_card_removed(card); @@ -2570,7 +2570,7 @@ void mmc_rescan(struct work_struct *work) return; /* If there is a non-removable card registered, only scan once */ - if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered) + if (!mmc_card_is_removable(host) && host->rescan_entered) return; host->rescan_entered = 1; @@ -2587,8 +2587,7 @@ void mmc_rescan(struct work_struct *work) * if there is a _removable_ card registered, check whether it is * still present */ - if (host->bus_ops && !host->bus_dead - && !(host->caps & MMC_CAP_NONREMOVABLE)) + if (host->bus_ops && !host->bus_dead && mmc_card_is_removable(host)) host->bus_ops->detect(host); host->detect_change = 0; @@ -2613,7 +2612,7 @@ void mmc_rescan(struct work_struct *work) mmc_bus_put(host); mmc_claim_host(host); - if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd && + if (mmc_card_is_removable(host) && host->ops->get_cd && host->ops->get_cd(host) == 0) { mmc_power_off(host); mmc_release_host(host);