|
@@ -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;
|