diff options
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 1a47221d01a4..e7765a89593e 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -658,14 +658,21 @@ static void tmio_mmc_release_dma(struct tmio_mmc_host *host) | |||
658 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, | 658 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, |
659 | struct mmc_data *data) | 659 | struct mmc_data *data) |
660 | { | 660 | { |
661 | struct mfd_cell *cell = host->pdev->dev.platform_data; | ||
662 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
663 | |||
661 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", | 664 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", |
662 | data->blksz, data->blocks); | 665 | data->blksz, data->blocks); |
663 | 666 | ||
664 | /* Hardware cannot perform 1 and 2 byte requests in 4 bit mode */ | 667 | /* Some hardware cannot perform 2 byte requests in 4 bit mode */ |
665 | if (data->blksz < 4 && host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { | 668 | if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { |
666 | pr_err("%s: %d byte block unsupported in 4 bit mode\n", | 669 | int blksz_2bytes = pdata->flags & TMIO_MMC_BLKSZ_2BYTES; |
667 | mmc_hostname(host->mmc), data->blksz); | 670 | |
668 | return -EINVAL; | 671 | if (data->blksz < 2 || (data->blksz < 4 && !blksz_2bytes)) { |
672 | pr_err("%s: %d byte block unsupported in 4 bit mode\n", | ||
673 | mmc_hostname(host->mmc), data->blksz); | ||
674 | return -EINVAL; | ||
675 | } | ||
669 | } | 676 | } |
670 | 677 | ||
671 | tmio_mmc_init_sg(host, data); | 678 | tmio_mmc_init_sg(host, data); |