aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-13 14:03:01 -0400
committerMark Brown <broonie@linaro.org>2013-08-14 06:22:14 -0400
commitc12f964357fc6de54252a4134720083d687caa22 (patch)
treeed379a5eeac08951ab37f5bf025d6a9c99632fd5 /drivers/spi
parent3c729b4344456ebd520636563c854090e3dec611 (diff)
spi/s3c64xx: Take runtime PM reference even if DMA is not supported
We always need the device to be runtime PM enabled to use it so just skip the DMA initialisation not the entire prepare when polling. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c64xx.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index a7a739c89488..eee1a7b4adc4 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -429,27 +429,26 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
429 dma_cap_mask_t mask; 429 dma_cap_mask_t mask;
430 int ret; 430 int ret;
431 431
432 if (is_polling(sdd)) 432 if (!is_polling(sdd)) {
433 return 0; 433 dma_cap_zero(mask);
434 434 dma_cap_set(DMA_SLAVE, mask);
435 dma_cap_zero(mask); 435
436 dma_cap_set(DMA_SLAVE, mask); 436 /* Acquire DMA channels */
437 437 sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
438 /* Acquire DMA channels */ 438 (void *)sdd->rx_dma.dmach, dev, "rx");
439 sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter, 439 if (!sdd->rx_dma.ch) {
440 (void *)sdd->rx_dma.dmach, dev, "rx"); 440 dev_err(dev, "Failed to get RX DMA channel\n");
441 if (!sdd->rx_dma.ch) { 441 ret = -EBUSY;
442 dev_err(dev, "Failed to get RX DMA channel\n"); 442 goto out;
443 ret = -EBUSY; 443 }
444 goto out;
445 }
446 444
447 sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter, 445 sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
448 (void *)sdd->tx_dma.dmach, dev, "tx"); 446 (void *)sdd->tx_dma.dmach, dev, "tx");
449 if (!sdd->tx_dma.ch) { 447 if (!sdd->tx_dma.ch) {
450 dev_err(dev, "Failed to get TX DMA channel\n"); 448 dev_err(dev, "Failed to get TX DMA channel\n");
451 ret = -EBUSY; 449 ret = -EBUSY;
452 goto out_rx; 450 goto out_rx;
451 }
453 } 452 }
454 453
455 ret = pm_runtime_get_sync(&sdd->pdev->dev); 454 ret = pm_runtime_get_sync(&sdd->pdev->dev);