From: Jaehoon Chung Date: Thu, 17 Nov 2016 07:40:34 +0000 (+0900) Subject: mmc: dw_mmc: fix the debug message for checking card's present X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f4d50790b74ff9ed9e3bfd14f880be5eb6c64af;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mmc: dw_mmc: fix the debug message for checking card's present 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 Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 3cf2490b16bd..441ca447c4ba 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1538,13 +1538,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;