From: Mark Brown <[email protected]>

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 <[email protected]>
---
 drivers/spi/spi-s3c64xx.c | 39 +++++++++++++++++++--------------------
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 9b4e54d..23c93af 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -426,27 +426,26 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master 
*spi)
        dma_cap_mask_t mask;
        int ret;
 
-       if (is_polling(sdd))
-               return 0;
-
-       dma_cap_zero(mask);
-       dma_cap_set(DMA_SLAVE, mask);
-
-       /* Acquire DMA channels */
-       sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-                               (void *)sdd->rx_dma.dmach, dev, "rx");
-       if (!sdd->rx_dma.ch) {
-               dev_err(dev, "Failed to get RX DMA channel\n");
-               ret = -EBUSY;
-               goto out;
-       }
+       if (!is_polling(sdd)) {
+               dma_cap_zero(mask);
+               dma_cap_set(DMA_SLAVE, mask);
+
+               /* Acquire DMA channels */
+               sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
+                                  (void *)sdd->rx_dma.dmach, dev, "rx");
+               if (!sdd->rx_dma.ch) {
+                       dev_err(dev, "Failed to get RX DMA channel\n");
+                       ret = -EBUSY;
+                       goto out;
+               }
 
-       sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
-                               (void *)sdd->tx_dma.dmach, dev, "tx");
-       if (!sdd->tx_dma.ch) {
-               dev_err(dev, "Failed to get TX DMA channel\n");
-               ret = -EBUSY;
-               goto out_rx;
+               sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
+                                  (void *)sdd->tx_dma.dmach, dev, "tx");
+               if (!sdd->tx_dma.ch) {
+                       dev_err(dev, "Failed to get TX DMA channel\n");
+                       ret = -EBUSY;
+                       goto out_rx;
+               }
        }
 
        ret = pm_runtime_get_sync(&sdd->pdev->dev);
-- 
1.8.4.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to