From patchwork Thu Nov 3 06:21:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9410407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4574660573 for ; Thu, 3 Nov 2016 06:24:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36FC12A4FF for ; Thu, 3 Nov 2016 06:24:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B7882A516; Thu, 3 Nov 2016 06:24:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BA47A2A4FF for ; Thu, 3 Nov 2016 06:24:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2BQ1-0003fo-Kz; Thu, 03 Nov 2016 06:22:33 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2BPZ-0003HX-Iz; Thu, 03 Nov 2016 06:22:11 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OG101XOKYZVP780@mailout1.samsung.com>; Thu, 03 Nov 2016 15:21:43 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-ca-581ad7777616 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id B2.3B.16530.777DA185; Thu, 3 Nov 2016 15:21:43 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OG100J7YZ02LAA0@mmp1.samsung.com>; Thu, 03 Nov 2016 15:21:43 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Subject: [PATCH 02/13] mmc: dw_mmc: fix the debug message for checking card's present Date: Thu, 03 Nov 2016 15:21:24 +0900 Message-id: <20161103062135.10697-3-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161103062135.10697-1-jh80.chung@samsung.com> References: <20161103062135.10697-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42I5/e+xgG75dakIg2/d/Bbzj5xjtfj/6DWr xY1fbawW589vYLfY9Pgaq8XlXXPYLI7872e0+PTgP7PFjPP7mCxa9x5ht7jzZD2rxfG14Q48 HptWdbJ53Lm2h81j85J6j7+z9rN49G1Zxeix/do8Zo/Pm+QC2KPcbDJSE1NSixRS85LzUzLz 0m2VQkPcdC2UFPISc1NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fglnGndydLQRdHRXP7 WZYGxidsXYycHBICJhIrz65hhrDFJC7cWw8U5+IQEljKKLFjfz8zhPODUeLrszcsIFVsAjoS 278dZwKxRQRkJX7+uQDWwSxwkEni/6TdYEXCAuESN05OYwexWQRUJX6v2Ahm8wpYS/TN/sMI sU5e4sLVU2D1nAI2EhOPNLOC2EJANbcOr2SawMi7gJFhFaNEakFyQXFSeq5RXmq5XnFibnFp Xrpecn7uJkZwZDyT3sF4eJf7IUYBDkYlHt4HiVIRQqyJZcWVuYcYJTiYlUR4d10BCvGmJFZW pRblxxeV5qQWH2I0BTpsIrOUaHI+MGrzSuINTcxNzI0NLMwtLU2MlMR5G2c/CxcSSE8sSc1O TS1ILYLpY+LglGpgnF1acsxp132/6EsXxQ8c2FHT9VznZUy3od6tsn1zK/9mf7h5tq/VS2Fr 2XHdIwK7pPYeE9ti8bl+WjLrSTPPmjulvR9us0v4abeeS3R4HcvqnKYwm7XMtG3ape8dE78u 3P392mTP+H2zHF7K7bNNrm3p/7ljWnSA6GF5vhXl3xZoxXJ832CUo8RSnJFoqMVcVJwIAPzT fA2iAgAA X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_232205_831407_9D255A52 X-CRM114-Status: GOOD ( 10.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, ulf.hansson@linaro.org, linux-samsung-soc@vger.kernel.org, heiko@sntech.de, shawn.lin@rock-chips.com, linux-kernel@vger.kernel.org, krzk@kernel.org, Jaehoon Chung , linux-rockchip@lists.infradead.org, robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If display the debug message, this message should be spamming. If flags is maintained the previous value, didn't display the debug message. Signed-off-by: Jaehoon Chung --- drivers/mmc/host/dw_mmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index b87dd07..1e71fd4 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1537,13 +1537,10 @@ static int dw_mci_get_cd(struct mmc_host *mmc) == 0 ? 1 : 0; spin_lock_bh(&host->lock); - if (present) { - set_bit(DW_MMC_CARD_PRESENT, &slot->flags); + if (present && !test_and_set_bit(DW_MMC_CARD_PRESENT, &slot->flags)) dev_dbg(&mmc->class_dev, "card is present\n"); - } else { - clear_bit(DW_MMC_CARD_PRESENT, &slot->flags); + else if (!test_and_clear_bit(DW_MMC_CARD_PRESENT, &slot->flags)) dev_dbg(&mmc->class_dev, "card is not present\n"); - } spin_unlock_bh(&host->lock); return present;