MLK-14276-2 mmc: sdhci: remove IS_ERR_VALUE abuses
authorHaibo Chen <haibo.chen@nxp.com>
Tue, 28 Feb 2017 11:12:14 +0000 (19:12 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:10:47 +0000 (15:10 -0500)
It is wrong to pass 'int' to IS_ERR_VALUE(), Linus's commit
aa00edc1 point out this abuse.

This patch use operator instead.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
drivers/mmc/host/sdhci.c

index 3521d51..91e06e4 100644 (file)
@@ -120,7 +120,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable)
        int gpio_cd = mmc_gpio_get_cd(host->mmc);
 
        if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
-           !mmc_card_is_removable(host->mmc) || !IS_ERR_VALUE(gpio_cd))
+           !mmc_card_is_removable(host->mmc) || (gpio_cd >= 0))
                return;
 
        if (enable) {
@@ -2828,7 +2828,7 @@ void sdhci_enable_irq_wakeups(struct sdhci_host *host)
        val |= mask ;
        /* Avoid fake wake up */
        if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION ||
-           !IS_ERR_VALUE(gpio_cd)) {
+           (gpio_cd >= 0)) {
                val &= ~(SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE);
                irq_val &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE);
        }