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

ata/pata_arasan_cf: fill dma chan->private from pdata->dma_priv

Some DMA controllers (eg: drivers/dma/dw_dmac*) allow platform specific
configuration for dma transfers. User drivers need to set chan->private field
of channel with pointer to configuration data. This patch takes dma_priv data
from platform data and passes it to chan->private_data, in order to pass
platform specific configuration to DMAC controller.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

authored by

Viresh Kumar and committed by
Jeff Garzik
60a230e4 8d7b1c70

+8 -1
+6 -1
drivers/ata/pata_arasan_cf.c
··· 210 210 struct dma_chan *dma_chan; 211 211 /* Mask for DMA transfers */ 212 212 dma_cap_mask_t mask; 213 + /* dma channel private data */ 214 + void *dma_priv; 213 215 /* DMA transfer work */ 214 216 struct work_struct work; 215 217 /* DMA delayed finish work */ ··· 358 356 359 357 static bool filter(struct dma_chan *chan, void *slave) 360 358 { 359 + chan->private = slave; 361 360 return true; 362 361 } 363 362 ··· 529 526 530 527 /* request dma channels */ 531 528 /* dma_request_channel may sleep, so calling from process context */ 532 - acdev->dma_chan = dma_request_channel(acdev->mask, filter, NULL); 529 + acdev->dma_chan = dma_request_channel(acdev->mask, filter, 530 + acdev->dma_priv); 533 531 if (!acdev->dma_chan) { 534 532 dev_err(acdev->host->dev, "Unable to get dma_chan\n"); 535 533 goto chan_request_fail; ··· 857 853 INIT_WORK(&acdev->work, data_xfer); 858 854 INIT_DELAYED_WORK(&acdev->dwork, delayed_finish); 859 855 dma_cap_set(DMA_MEMCPY, acdev->mask); 856 + acdev->dma_priv = pdata->dma_priv; 860 857 861 858 /* Handle platform specific quirks */ 862 859 if (pdata->quirk) {
+2
include/linux/pata_arasan_cf_data.h
··· 37 37 #define CF_BROKEN_PIO (1) 38 38 #define CF_BROKEN_MWDMA (1 << 1) 39 39 #define CF_BROKEN_UDMA (1 << 2) 40 + /* This is platform specific data for the DMA controller */ 41 + void *dma_priv; 40 42 }; 41 43 42 44 static inline void