diff options
| -rw-r--r-- | drivers/spi/spi-fsl-spi.c | 3 | ||||
| -rw-r--r-- | drivers/spi/spi-imx.c | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index d2407558773f..24cacff57786 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c | |||
| @@ -825,6 +825,9 @@ static void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi) | |||
| 825 | { | 825 | { |
| 826 | struct device *dev = mspi->dev; | 826 | struct device *dev = mspi->dev; |
| 827 | 827 | ||
| 828 | if (!(mspi->flags & SPI_CPM_MODE)) | ||
| 829 | return; | ||
| 830 | |||
| 828 | dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE); | 831 | dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE); |
| 829 | dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE); | 832 | dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE); |
| 830 | cpm_muram_free(cpm_muram_offset(mspi->tx_bd)); | 833 | cpm_muram_free(cpm_muram_offset(mspi->tx_bd)); |
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 8ac6542aedcd..fa594d604aca 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c | |||
| @@ -786,9 +786,11 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
| 786 | int cs_gpio = of_get_named_gpio(np, "cs-gpios", i); | 786 | int cs_gpio = of_get_named_gpio(np, "cs-gpios", i); |
| 787 | if (cs_gpio < 0) | 787 | if (cs_gpio < 0) |
| 788 | cs_gpio = mxc_platform_info->chipselect[i]; | 788 | cs_gpio = mxc_platform_info->chipselect[i]; |
| 789 | |||
| 790 | spi_imx->chipselect[i] = cs_gpio; | ||
| 789 | if (cs_gpio < 0) | 791 | if (cs_gpio < 0) |
| 790 | continue; | 792 | continue; |
| 791 | spi_imx->chipselect[i] = cs_gpio; | 793 | |
| 792 | ret = gpio_request(spi_imx->chipselect[i], DRIVER_NAME); | 794 | ret = gpio_request(spi_imx->chipselect[i], DRIVER_NAME); |
| 793 | if (ret) { | 795 | if (ret) { |
| 794 | while (i > 0) { | 796 | while (i > 0) { |
