Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / host / mmci.c
index 7edae83603dd670bd9a2458b54e677513e61a944..840b301b567142b4e264924a14feb91c5cb54003 100644 (file)
@@ -575,9 +575,13 @@ static int mmci_get_cd(struct mmc_host *mmc)
        if (host->gpio_cd == -ENOSYS)
                status = host->plat->status(mmc_dev(host->mmc));
        else
-               status = gpio_get_value(host->gpio_cd);
+               status = !gpio_get_value(host->gpio_cd);
 
-       return !status;
+       /*
+        * Use positive logic throughout - status is zero for no card,
+        * non-zero for card inserted.
+        */
+       return status;
 }
 
 static const struct mmc_host_ops mmci_ops = {