Commit c12f9643 authored by Mark Brown's avatar Mark Brown

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: default avatarMark Brown <broonie@linaro.org>
parent 3c729b43
...@@ -429,27 +429,26 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) ...@@ -429,27 +429,26 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
dma_cap_mask_t mask; dma_cap_mask_t mask;
int ret; int ret;
if (is_polling(sdd)) if (!is_polling(sdd)) {
return 0; dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); /* Acquire DMA channels */
sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter,
/* Acquire DMA channels */ (void *)sdd->rx_dma.dmach, dev, "rx");
sdd->rx_dma.ch = dma_request_slave_channel_compat(mask, filter, if (!sdd->rx_dma.ch) {
(void *)sdd->rx_dma.dmach, dev, "rx"); dev_err(dev, "Failed to get RX DMA channel\n");
if (!sdd->rx_dma.ch) { ret = -EBUSY;
dev_err(dev, "Failed to get RX DMA channel\n"); goto out;
ret = -EBUSY; }
goto out;
}
sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter, sdd->tx_dma.ch = dma_request_slave_channel_compat(mask, filter,
(void *)sdd->tx_dma.dmach, dev, "tx"); (void *)sdd->tx_dma.dmach, dev, "tx");
if (!sdd->tx_dma.ch) { if (!sdd->tx_dma.ch) {
dev_err(dev, "Failed to get TX DMA channel\n"); dev_err(dev, "Failed to get TX DMA channel\n");
ret = -EBUSY; ret = -EBUSY;
goto out_rx; goto out_rx;
}
} }
ret = pm_runtime_get_sync(&sdd->pdev->dev); ret = pm_runtime_get_sync(&sdd->pdev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment