diff options
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
| -rw-r--r-- | drivers/mmc/host/atmel-mci.c | 19 | 
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 8072128e933..fb279f4ed8b 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -22,6 +22,7 @@  #include <linux/platform_device.h>  #include <linux/scatterlist.h>  #include <linux/seq_file.h> +#include <linux/slab.h>  #include <linux/stat.h>  #include <linux/mmc/host.h> @@ -265,7 +266,7 @@ static int atmci_req_show(struct seq_file *s, void *v)  				"CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n",  				cmd->opcode, cmd->arg, cmd->flags,  				cmd->resp[0], cmd->resp[1], cmd->resp[2], -				cmd->resp[2], cmd->error); +				cmd->resp[3], cmd->error);  		if (data)  			seq_printf(s, "DATA %u / %u * %u flg %x err %d\n",  				data->bytes_xfered, data->blocks, @@ -275,7 +276,7 @@ static int atmci_req_show(struct seq_file *s, void *v)  				"CMD%u(0x%x) flg %x rsp %x %x %x %x err %d\n",  				stop->opcode, stop->arg, stop->flags,  				stop->resp[0], stop->resp[1], stop->resp[2], -				stop->resp[2], stop->error); +				stop->resp[3], stop->error);  	}  	spin_unlock_bh(&slot->host->lock); @@ -568,9 +569,10 @@ static void atmci_dma_cleanup(struct atmel_mci *host)  {  	struct mmc_data			*data = host->data; -	dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, -		     ((data->flags & MMC_DATA_WRITE) -		      ? DMA_TO_DEVICE : DMA_FROM_DEVICE)); +	if (data) +		dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len, +			     ((data->flags & MMC_DATA_WRITE) +			      ? DMA_TO_DEVICE : DMA_FROM_DEVICE));  }  static void atmci_stop_dma(struct atmel_mci *host) @@ -1098,8 +1100,8 @@ static void atmci_command_complete(struct atmel_mci *host,  			"command error: status=0x%08x\n", status);  		if (cmd->data) { -			host->data = NULL;  			atmci_stop_dma(host); +			host->data = NULL;  			mci_writel(host, IDR, MCI_NOTBUSY  					| MCI_TXRDY | MCI_RXRDY  					| ATMCI_DATA_ERROR_FLAGS); @@ -1292,6 +1294,7 @@ static void atmci_tasklet_func(unsigned long priv)  			} else {  				data->bytes_xfered = data->blocks * data->blksz;  				data->error = 0; +				mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS);  			}  			if (!data->stop) { @@ -1750,13 +1753,13 @@ static int __init atmci_probe(struct platform_device *pdev)  	ret = -ENODEV;  	if (pdata->slot[0].bus_width) {  		ret = atmci_init_slot(host, &pdata->slot[0], -				MCI_SDCSEL_SLOT_A, 0); +				0, MCI_SDCSEL_SLOT_A);  		if (!ret)  			nr_slots++;  	}  	if (pdata->slot[1].bus_width) {  		ret = atmci_init_slot(host, &pdata->slot[1], -				MCI_SDCSEL_SLOT_B, 1); +				1, MCI_SDCSEL_SLOT_B);  		if (!ret)  			nr_slots++;  	}  |