Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: jz4740: Use dma_request_chan()

Replace dma_request_channel() with dma_request_chan(),
which also supports probing from the devicetree.

Tested-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Ezequiel Garcia and committed by
Ulf Hansson
fb0ce9dd 6a78768a

+7 -15
+7 -15
drivers/mmc/host/jz4740_mmc.c
··· 213 213 214 214 static int jz4740_mmc_acquire_dma_channels(struct jz4740_mmc_host *host) 215 215 { 216 - dma_cap_mask_t mask; 217 - 218 - dma_cap_zero(mask); 219 - dma_cap_set(DMA_SLAVE, mask); 220 - 221 - host->dma_tx = dma_request_channel(mask, NULL, host); 222 - if (!host->dma_tx) { 216 + host->dma_tx = dma_request_chan(mmc_dev(host->mmc), "tx"); 217 + if (IS_ERR(host->dma_tx)) { 223 218 dev_err(mmc_dev(host->mmc), "Failed to get dma_tx channel\n"); 224 - return -ENODEV; 219 + return PTR_ERR(host->dma_tx); 225 220 } 226 221 227 - host->dma_rx = dma_request_channel(mask, NULL, host); 228 - if (!host->dma_rx) { 222 + host->dma_rx = dma_request_chan(mmc_dev(host->mmc), "rx"); 223 + if (IS_ERR(host->dma_rx)) { 229 224 dev_err(mmc_dev(host->mmc), "Failed to get dma_rx channel\n"); 230 - goto free_master_write; 225 + dma_release_channel(host->dma_tx); 226 + return PTR_ERR(host->dma_rx); 231 227 } 232 228 233 229 /* Initialize DMA pre request cookie */ 234 230 host->next_data.cookie = 1; 235 231 236 232 return 0; 237 - 238 - free_master_write: 239 - dma_release_channel(host->dma_tx); 240 - return -ENODEV; 241 233 } 242 234 243 235 static inline struct dma_chan *jz4740_mmc_get_dma_chan(struct jz4740_mmc_host *host,