Skip to content

Commit dde0221

Browse files
dmosbergerKalle Valo
authored andcommitted
wilc1000: Remove misleading USE_SPI_DMA macro
The USE_SPI_DMA macro name suggests that it could be set to 1 to control whether or not SPI DMA should be used. However, that's not what it does. If set to 1, it'll set the SPI messages' "is_dma_mapped" flag to true, even though the tx/rx buffers aren't actually DMA mapped by the driver. In other words, setting this flag to 1 will break the driver. Best to clean up this confusion by removing the macro altogether. There is no need to explicitly initialize "is_dma_mapped" because the message is cleared to zero anyhow, so "is_dma_mapped" is set to false by default. Signed-off-by: David Mosberger-Tang <davidm@egauge.net> Acked-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20211207002453.3193737-1-davidm@egauge.net
1 parent 5ae6606 commit dde0221

File tree

1 file changed

+0
-5
lines changed
  • drivers/net/wireless/microchip/wilc1000

1 file changed

+0
-5
lines changed

drivers/net/wireless/microchip/wilc1000/spi.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ static int wilc_spi_reset(struct wilc *wilc);
9999
#define DATA_PKT_LOG_SZ DATA_PKT_LOG_SZ_MAX
100100
#define DATA_PKT_SZ (1 << DATA_PKT_LOG_SZ)
101101

102-
#define USE_SPI_DMA 0
103-
104102
#define WILC_SPI_COMMAND_STAT_SUCCESS 0
105103
#define WILC_GET_RESP_HDR_START(h) (((h) >> 4) & 0xf)
106104

@@ -247,7 +245,6 @@ static int wilc_spi_tx(struct wilc *wilc, u8 *b, u32 len)
247245
memset(&msg, 0, sizeof(msg));
248246
spi_message_init(&msg);
249247
msg.spi = spi;
250-
msg.is_dma_mapped = USE_SPI_DMA;
251248
spi_message_add_tail(&tr, &msg);
252249

253250
ret = spi_sync(spi, &msg);
@@ -291,7 +288,6 @@ static int wilc_spi_rx(struct wilc *wilc, u8 *rb, u32 rlen)
291288
memset(&msg, 0, sizeof(msg));
292289
spi_message_init(&msg);
293290
msg.spi = spi;
294-
msg.is_dma_mapped = USE_SPI_DMA;
295291
spi_message_add_tail(&tr, &msg);
296292

297293
ret = spi_sync(spi, &msg);
@@ -330,7 +326,6 @@ static int wilc_spi_tx_rx(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen)
330326
memset(&msg, 0, sizeof(msg));
331327
spi_message_init(&msg);
332328
msg.spi = spi;
333-
msg.is_dma_mapped = USE_SPI_DMA;
334329

335330
spi_message_add_tail(&tr, &msg);
336331
ret = spi_sync(spi, &msg);

0 commit comments

Comments
 (0)