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: 9410425 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 7F98460573 for ; Thu, 3 Nov 2016 06:25:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 715182A513 for ; Thu, 3 Nov 2016 06:25:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 663B02A51A; Thu, 3 Nov 2016 06:25:09 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11D612A516 for ; Thu, 3 Nov 2016 06:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754725AbcKCGYs (ORCPT ); Thu, 3 Nov 2016 02:24:48 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:37824 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbcKCGVp (ORCPT ); Thu, 3 Nov 2016 02:21:45 -0400 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 Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, ulf.hansson@linaro.org, robh+dt@kernel.org, krzk@kernel.org, heiko@sntech.de, shawn.lin@rock-chips.com, Jaehoon Chung 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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;