]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/core/sdio_cis.c
Remove executable permission for dma.c
[linux-2.6-omap-h63xx.git] / drivers / mmc / core / sdio_cis.c
index d5e51b1c7b3fb715ebc81dcad5468c572748d42e..963f2937c5e37da83819249826995aa098751f99 100644 (file)
@@ -129,6 +129,12 @@ static int cistpl_funce_func(struct sdio_func *func,
        /* TPLFE_MAX_BLK_SIZE */
        func->max_blksize = buf[12] | (buf[13] << 8);
 
+       /* TPLFE_ENABLE_TIMEOUT_VAL, present in ver 1.1 and above */
+       if (vsn > SDIO_SDIO_REV_1_00)
+               func->enable_timeout = (buf[28] | (buf[29] << 8)) * 10;
+       else
+               func->enable_timeout = jiffies_to_msecs(HZ);
+
        return 0;
 }
 
@@ -217,10 +223,18 @@ static int sdio_read_cis(struct mmc_card *card, struct sdio_func *func)
                if (tpl_code == 0xff)
                        break;
 
+               /* null entries have no link field or data */
+               if (tpl_code == 0x00)
+                       continue;
+
                ret = mmc_io_rw_direct(card, 0, 0, ptr++, 0, &tpl_link);
                if (ret)
                        break;
 
+               /* a size of 0xff also means we're done */
+               if (tpl_link == 0xff)
+                       break;
+
                this = kmalloc(sizeof(*this) + tpl_link, GFP_KERNEL);
                if (!this)
                        return -ENOMEM;