From patchwork Thu Jan 28 23:52:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 8155141 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 5A63D9F818 for ; Thu, 28 Jan 2016 23:53:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86F6320361 for ; Thu, 28 Jan 2016 23:53:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0694F20340 for ; Thu, 28 Jan 2016 23:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751215AbcA1XxD (ORCPT ); Thu, 28 Jan 2016 18:53:03 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:33593 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbcA1XxB (ORCPT ); Thu, 28 Jan 2016 18:53:01 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O1O00DUJT0BI450@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Fri, 29 Jan 2016 08:52:59 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 7F.FB.04949.BD9AAA65; Fri, 29 Jan 2016 08:52:59 +0900 (KST) X-AuditID: cbfee68d-f79646d000001355-79-56aaa9dbc9be Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 10.6E.09068.BD9AAA65; Fri, 29 Jan 2016 08:52:59 +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 <0O1O00F09T0BSB40@mmp2.samsung.com>; Fri, 29 Jan 2016 08:52:59 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH] mmc: core: use the defined function to check whether card is removable Date: Fri, 29 Jan 2016 08:52:57 +0900 Message-id: <1454025177-21233-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBLMWRmVeSWpSXmKPExsWyRsSkRPf2ylVhBjP/m1ucfLKGzeLGrzZW iyP/+xkt7jxZz2pxfG24A6vH4j0vmTzuXNvD5vF31n4Wj74tqxg9Pm+SC2CN4rJJSc3JLEst 0rdL4Mp49aKHvWAlb0Xfx3UsDYy/uboYOTkkBEwk5h17xAhhi0lcuLeerYuRi0NIYAWjxJdp TSwwRe1PT7GC2EICsxglNlxThij6wSjR3XGZHSTBJqAjsf3bcSYQW0RAVuLnnwtsIDazQLnE vg0HwWxhgUiJJ+9egg1lEVCV6Og4wQxi8wq4Sfza1wl1hZzEyWOTWUEWSAh8ZpNYsLiRHaJB QOLb5ENAzRxACVmJTQeYIeolJQ6uuMEygVFwASPDKkbR1ILkguKk9CJDveLE3OLSvHS95Pzc TYzAAD3971nvDsbbB6wPMQpwMCrx8HakrwoTYk0sK67MPcRoCrRhIrOUaHI+MA7ySuINjc2M LExNTI2NzC3NlMR5FaV+BgsJpCeWpGanphakFsUXleakFh9iZOLglGpgdPk09dAMa66Qd6En GrOWCvA/4plxVky4P57P+n2L+Kfw4oCv6rx5/V590x5pXFiqfGb/tJd3573k2hzDfUQ4sbBj 5aP52jUdx7tcP7SLvVG4IXGjQCpG26ss/5LQ6zePN8z4LF/xfnfjsq3LC5aIq9wvnVA0S0Zj 2lrOR8wlovy7PHOPs50vVGIpzkg01GIuKk4EAFL9g0lLAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42I5/e+xoO7tlavCDJY1GlqcfLKGzeLGrzZW iyP/+xkt7jxZz2pxfG24A6vH4j0vmTzuXNvD5vF31n4Wj74tqxg9Pm+SC2CNamC0yUhNTEkt UkjNS85PycxLt1XyDo53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXLzAFarqRQlphTChQKSCwu VtK3wzQhNMRN1wKmMULXNyQIrsfIAA0krGHMePWih71gJW9F38d1LA2Mv7m6GDk5JARMJNqf nmKFsMUkLtxbzwZiCwnMYpTYcE25i5ELyP7BKNHdcZkdJMEmoCOx/dtxJhBbREBW4uefC2AN zALlEvs2HASzhQUiJZ68e8kCYrMIqEp0dJxgBrF5Bdwkfu3rZIRYJidx8thk1gmM3AsYGVYx SqQWJBcUJ6XnGuWllusVJ+YWl+al6yXn525iBEfBM+kdjId3uR9iFOBgVOLh7UhfFSbEmlhW XJl7iFGCg1lJhHfrdKAQb0piZVVqUX58UWlOavEhRlOgAyYyS4km5wMjNK8k3tDYxMzI0sjc 0MLI2FxJnHffpcgwIYH0xJLU7NTUgtQimD4mDk6pBsa16qv5Hk6tn9BYH3ZDNZZb34Xx47tu vvbPmr2tq1+tmX+cNznpelC75vS1Fntnzl7Uln5N7Hkg/4rDnPzLl51T1TxxMFRm7qQ/P+ea GhtKNEt9VXU+e/QW63OpySrbLfw29wrtX6Ya5lCfdd3h2e0zq/w2b36WvXhG5yvbq2uf5yYw NdeVlfEpsRRnJBpqMRcVJwIAP+bPQ5gCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-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);