Skip to content

Commit b3f82dc

Browse files
andy-shevbroonie
authored andcommitted
spi: dw: Make DMA request line assignments explicit for Intel Medfield
The 2afccbd ("spi: dw: Discard static DW DMA slave structures") did a clean up of global variables, which is fine, but messed up with the carefully provided information in the custom DMA slave structures. There reader can find an assignment of the DMA request lines in use. Partially revert the above mentioned commit to restore readability and maintainability of the code. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d62069c commit b3f82dc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/spi/spi-dw-dma.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ static void dw_spi_dma_maxburst_init(struct dw_spi *dws)
6161

6262
static int dw_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
6363
{
64-
struct dw_dma_slave slave = {
65-
.src_id = 0,
66-
.dst_id = 0
67-
};
64+
struct dw_dma_slave dma_tx = { .dst_id = 1 }, *tx = &dma_tx;
65+
struct dw_dma_slave dma_rx = { .src_id = 0 }, *rx = &dma_rx;
6866
struct pci_dev *dma_dev;
6967
dma_cap_mask_t mask;
7068

@@ -80,14 +78,14 @@ static int dw_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
8078
dma_cap_set(DMA_SLAVE, mask);
8179

8280
/* 1. Init rx channel */
83-
slave.dma_dev = &dma_dev->dev;
84-
dws->rxchan = dma_request_channel(mask, dw_spi_dma_chan_filter, &slave);
81+
rx->dma_dev = &dma_dev->dev;
82+
dws->rxchan = dma_request_channel(mask, dw_spi_dma_chan_filter, rx);
8583
if (!dws->rxchan)
8684
goto err_exit;
8785

8886
/* 2. Init tx channel */
89-
slave.dst_id = 1;
90-
dws->txchan = dma_request_channel(mask, dw_spi_dma_chan_filter, &slave);
87+
tx->dma_dev = &dma_dev->dev;
88+
dws->txchan = dma_request_channel(mask, dw_spi_dma_chan_filter, tx);
9189
if (!dws->txchan)
9290
goto free_rxchan;
9391

0 commit comments

Comments
 (0)