From patchwork Fri May 23 12:33:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 4232011 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8F3FBF90B for ; Fri, 23 May 2014 12:33:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1DDDF203A0 for ; Fri, 23 May 2014 12:33:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FD9F20295 for ; Fri, 23 May 2014 12:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbaEWMdZ (ORCPT ); Fri, 23 May 2014 08:33:25 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:43525 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751655AbaEWMdY (ORCPT ); Fri, 23 May 2014 08:33:24 -0400 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:a236:9fff:fe00:814]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Wnoeg-0006lv-Jl; Fri, 23 May 2014 14:32:58 +0200 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.82) (envelope-from ) id 1Wnoen-0001YR-Iy; Fri, 23 May 2014 14:33:05 +0200 From: Sascha Hauer To: linux-mmc@vger.kernel.org Cc: Shawn Guo , , kernel@pengutronix.de, Sascha Hauer Subject: [PATCH 3/5] mmc: sdhci-esdhc-imx: straighten SDHCI_QUIRK_BROKEN_CARD_DETECTION flag Date: Fri, 23 May 2014 14:33:02 +0200 Message-Id: <1400848384-3226-4-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.0.0.rc0 In-Reply-To: <1400848384-3226-1-git-send-email-s.hauer@pengutronix.de> References: <1400848384-3226-1-git-send-email-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:a236:9fff:fe00:814 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The driver always sets the flag and clears it afterwards in some cases. Instead, leave the flag cleared and set it when needed which makes the code easier to read. Signed-off-by: Sascha Hauer --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index f6f7a45..620cbcd 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -893,8 +893,7 @@ static struct sdhci_ops sdhci_esdhc_ops = { static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = { .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC - | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC - | SDHCI_QUIRK_BROKEN_CARD_DETECTION, + | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC, .ops = &sdhci_esdhc_ops, }; @@ -1084,18 +1083,18 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) "failed to request card-detect gpio!\n"); goto disable_clk; } - /* fall through */ + break; case ESDHC_CD_CONTROLLER: - /* we have a working card_detect back */ - host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; break; case ESDHC_CD_PERMANENT: host->mmc->caps |= MMC_CAP_NONREMOVABLE; + host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; break; case ESDHC_CD_NONE: + host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; break; }