From patchwork Thu Nov 17 07:40:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9433577 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 9D27060755 for ; Thu, 17 Nov 2016 07:40:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F1D7292B0 for ; Thu, 17 Nov 2016 07:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83F40292B3; Thu, 17 Nov 2016 07:40:58 +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 3A1C9292B0 for ; Thu, 17 Nov 2016 07:40:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbcKQHk5 (ORCPT ); Thu, 17 Nov 2016 02:40:57 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:58231 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbcKQHk5 (ORCPT ); Thu, 17 Nov 2016 02:40:57 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OGR01SAEZZO5X60@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Thu, 17 Nov 2016 16:40:42 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-03-582d5efa0a27 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id A4.4F.25310.AFE5D285; Thu, 17 Nov 2016 16:40:42 +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 <0OGR00EHCZZUI940@mmp1.samsung.com>; Thu, 17 Nov 2016 16:40:42 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, adrian.hunter@intel.com, Jaehoon Chung Subject: [PATCHv3 2/9] mmc: dw_mmc: fix the debug message for checking card's present Date: Thu, 17 Nov 2016 16:40:34 +0900 Message-id: <20161117074041.8641-3-jh80.chung@samsung.com> X-Mailer: git-send-email 2.10.1 In-reply-to: <20161117074041.8641-1-jh80.chung@samsung.com> References: <20161117074041.8641-1-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRmVeSWpSXmKPExsVy+t9jAd1fcboRBh+6VS1OPlnDZnHjVxur xZH//YwWd56sZ7U4vjbcgdVj8Z6XTB53ru1h8/g7az+LR9+WVYwenzfJBbBGudlkpCampBYp pOYl56dk5qXbKoWGuOlaKCnkJeam2ipF6PqGBCkplCXmlAJ5RgZowME5wD1YSd8uwS1j36ub TAWvOCp2HN7F3sC4i72LkZNDQsBEYufuK8wQtpjEhXvr2boYuTiEBJYySuyYf4YFwvnBKLFz 42KwDjYBHYnt344zgdgiArISP/9cYAOxmQXKJVZ9OckKYgsLhEt07Z3EAmKzCKhKPFzdA9bL K2Al0Xv7JRPENnmJC1dPAdVwcHAKWEv0/FIACQsBlZw+941tAiPvAkaGVYwSqQXJBcVJ6bmG eanlesWJucWleel6yfm5mxjBwftMagfjwV3uhxgFOBiVeHgn3NaJEGJNLCuuzD3EKMHBrCTC KxKkGyHEm5JYWZValB9fVJqTWnyI0RToronMUqLJ+cDIyiuJNzQxNzE3NrAwt7Q0MVIS522c /SxcSCA9sSQ1OzW1ILUIpo+Jg1OqgdGk3dNMZ86x5sXsoaqt9ht9RH5tP/KpsHFXza/7KSfP dTiK68zjlU/pNzu8bKFl6VPhiZYyzwyO1s+9PjP2NWPOteQkM6/V9yet/X5tyaW3QXdSCh1W Gj6qfF/waaI30/4NkaujOwUqN31fsOuG/oK7d8ztGE7Yf6yQeznTcH3qFvdHd/59SspTYinO SDTUYi4qTgQA09R0HHQCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 Tested-by: Heiko Stuebner Reviewed-by: Shawn Lin --- 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 7ffd57b..6adefb8 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;