summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-09-23 16:53:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-23 16:53:16 -0700
commitb172e38e435a158cc84169d5b9127a8dd8d21e76 (patch)
tree3a43151f8cc66ad84d043ce7e0e4a462240c6d85
parent8ec9c7fb15fd8edf6b34555f5b498033121b2173 (diff)
parent387719c2ec995019e0af0dc537ca17c9ebd5b64f (diff)
downloadlinux-3.10-b172e38e435a158cc84169d5b9127a8dd8d21e76.tar.gz
linux-3.10-b172e38e435a158cc84169d5b9127a8dd8d21e76.tar.bz2
linux-3.10-b172e38e435a158cc84169d5b9127a8dd8d21e76.zip
Merge branch 'spi/merge' of git://git.secretlab.ca/git/linux-2.6
* 'spi/merge' of git://git.secretlab.ca/git/linux-2.6: spi: Fix WARN when removing spi-fsl-spi module spi/imx: Fix spi-imx when the hardware SPI chipselects are used
-rw-r--r--drivers/spi/spi-fsl-spi.c3
-rw-r--r--drivers/spi/spi-imx.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index d2407558773..24cacff5778 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)
{
struct device *dev = mspi->dev;
+ if (!(mspi->flags & SPI_CPM_MODE))
+ return;
+
dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE);
dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE);
cpm_muram_free(cpm_muram_offset(mspi->tx_bd));
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 8ac6542aedc..fa594d604ac 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)
int cs_gpio = of_get_named_gpio(np, "cs-gpios", i);
if (cs_gpio < 0)
cs_gpio = mxc_platform_info->chipselect[i];
+
+ spi_imx->chipselect[i] = cs_gpio;
if (cs_gpio < 0)
continue;
- spi_imx->chipselect[i] = cs_gpio;
+
ret = gpio_request(spi_imx->chipselect[i], DRIVER_NAME);
if (ret) {
while (i > 0) {