]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/mmc/core/sdio.c
sdio: initialise SDIO functions and update card->sdio_funcs in lockstep
[mv-sheeva.git] / drivers / mmc / core / sdio.c
index cdb845b68ab5e37222048b47769014fa32186b8a..06b64085a355b3aed5198548b406ddcc79174a48 100644 (file)
@@ -516,7 +516,8 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
         * The number of functions on the card is encoded inside
         * the ocr.
         */
-       card->sdio_funcs = funcs = (ocr & 0x70000000) >> 28;
+       funcs = (ocr & 0x70000000) >> 28;
+       card->sdio_funcs = 0;
 
        /*
         * If needed, disconnect card detection pull-up resistor.
@@ -528,7 +529,7 @@ int mmc_attach_sdio(struct mmc_host *host, u32 ocr)
        /*
         * Initialize (but don't add) all present functions.
         */
-       for (i = 0;i < funcs;i++) {
+       for (i = 0; i < funcs; i++, card->sdio_funcs++) {
                err = sdio_init_func(host->card, i + 1);
                if (err)
                        goto remove;