diff options
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
| -rw-r--r-- | drivers/mmc/host/atmel-mci.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 88be37d9e9a5..fb279f4ed8b3 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
| @@ -266,7 +266,7 @@ static int atmci_req_show(struct seq_file *s, void *v) | |||
| 266 | "CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n", | 266 | "CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n", |
| 267 | cmd->opcode, cmd->arg, cmd->flags, | 267 | cmd->opcode, cmd->arg, cmd->flags, |
| 268 | cmd->resp[0], cmd->resp[1], cmd->resp[2], | 268 | cmd->resp[0], cmd->resp[1], cmd->resp[2], |
| 269 | cmd->resp[2], cmd->error); | 269 | cmd->resp[3], cmd->error); |
| 270 | if (data) | 270 | if (data) |
| 271 | seq_printf(s, "DATA %u / %u * %u flg %x err %d\n", | 271 | seq_printf(s, "DATA %u / %u * %u flg %x err %d\n", |
| 272 | data->bytes_xfered, data->blocks, | 272 | data->bytes_xfered, data->blocks, |
| @@ -276,7 +276,7 @@ static int atmci_req_show(struct seq_file *s, void *v) | |||
| 276 | "CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n", | 276 | "CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n", |
| 277 | stop->opcode, stop->arg, stop->flags, | 277 | stop->opcode, stop->arg, stop->flags, |
| 278 | stop->resp[0], stop->resp[1], stop->resp[2], | 278 | stop->resp[0], stop->resp[1], stop->resp[2], |
| 279 | stop->resp[2], stop->error); | 279 | stop->resp[3], stop->error); |
| 280 | } | 280 | } |
| 281 | 281 | ||
| 282 | spin_unlock_bh(&slot->host->lock); | 282 | spin_unlock_bh(&slot->host->lock); |
| @@ -569,9 +569,10 @@ static void atmci_dma_cleanup(struct atmel_mci *host) | |||
| 569 | { | 569 | { |
| 570 | struct mmc_data *data = host->data; | 570 | struct mmc_data *data = host->data; |
| 571 | 571 | ||
| 572 | dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, | 572 | if (data) |
| 573 | ((data->flags & MMC_DATA_WRITE) | 573 | dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, |
| 574 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); | 574 | ((data->flags & MMC_DATA_WRITE) |
| 575 | ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); | ||
| 575 | } | 576 | } |
| 576 | 577 | ||
| 577 | static void atmci_stop_dma(struct atmel_mci *host) | 578 | static void atmci_stop_dma(struct atmel_mci *host) |
| @@ -1099,8 +1100,8 @@ static void atmci_command_complete(struct atmel_mci *host, | |||
| 1099 | "command error: status=0x%08x\n", status); | 1100 | "command error: status=0x%08x\n", status); |
| 1100 | 1101 | ||
| 1101 | if (cmd->data) { | 1102 | if (cmd->data) { |
| 1102 | host->data = NULL; | ||
| 1103 | atmci_stop_dma(host); | 1103 | atmci_stop_dma(host); |
| 1104 | host->data = NULL; | ||
| 1104 | mci_writel(host, IDR, MCI_NOTBUSY | 1105 | mci_writel(host, IDR, MCI_NOTBUSY |
| 1105 | | MCI_TXRDY | MCI_RXRDY | 1106 | | MCI_TXRDY | MCI_RXRDY |
| 1106 | | ATMCI_DATA_ERROR_FLAGS); | 1107 | | ATMCI_DATA_ERROR_FLAGS); |
| @@ -1293,6 +1294,7 @@ static void atmci_tasklet_func(unsigned long priv) | |||
| 1293 | } else { | 1294 | } else { |
| 1294 | data->bytes_xfered = data->blocks * data->blksz; | 1295 | data->bytes_xfered = data->blocks * data->blksz; |
| 1295 | data->error = 0; | 1296 | data->error = 0; |
| 1297 | mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS); | ||
| 1296 | } | 1298 | } |
| 1297 | 1299 | ||
| 1298 | if (!data->stop) { | 1300 | if (!data->stop) { |
| @@ -1751,13 +1753,13 @@ static int __init atmci_probe(struct platform_device *pdev) | |||
| 1751 | ret = -ENODEV; | 1753 | ret = -ENODEV; |
| 1752 | if (pdata->slot[0].bus_width) { | 1754 | if (pdata->slot[0].bus_width) { |
| 1753 | ret = atmci_init_slot(host, &pdata->slot[0], | 1755 | ret = atmci_init_slot(host, &pdata->slot[0], |
| 1754 | MCI_SDCSEL_SLOT_A, 0); | 1756 | 0, MCI_SDCSEL_SLOT_A); |
| 1755 | if (!ret) | 1757 | if (!ret) |
| 1756 | nr_slots++; | 1758 | nr_slots++; |
| 1757 | } | 1759 | } |
| 1758 | if (pdata->slot[1].bus_width) { | 1760 | if (pdata->slot[1].bus_width) { |
| 1759 | ret = atmci_init_slot(host, &pdata->slot[1], | 1761 | ret = atmci_init_slot(host, &pdata->slot[1], |
| 1760 | MCI_SDCSEL_SLOT_B, 1); | 1762 | 1, MCI_SDCSEL_SLOT_B); |
| 1761 | if (!ret) | 1763 | if (!ret) |
| 1762 | nr_slots++; | 1764 | nr_slots++; |
| 1763 | } | 1765 | } |
