Skip to contentSkip to conversation

spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match

PATCH Applied Mika Westerberg 2 participants 2 messages Jan 13, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match

Commit cddb339badb0 (spi/pxa2xx: convert to dma_request_slave_channel_compat()) converted the driver to use ACPI provided DMA helpers but it forgot to initialize the platform data for the channels to -1. Failing to do so will result inadvertent match in the filter function because 0 is a valid channel number.

Prevent this from happening by initializing both platform data channels correctly to -1.

---
 drivers/spi/spi-pxa2xx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/spi/spi-pxa2xx.c +2 -0
index 7765b1999537..cbc68848789d 100644
@@ -1066,6 +1066,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
 
 	pdata->num_chipselect = 1;
 	pdata->enable_dma = true;
+	pdata->tx_chan_id = -1;
+	pdata->rx_chan_id = -1;
 
 	return pdata;
 }
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Applied
#1 lore raw
Quoted 5 lines · Mika Westerberg

Commit cddb339badb0 (spi/pxa2xx: convert to dma_request_slave_channel_compat()) converted the driver to use ACPI provided DMA helpers but it forgot to initialize the platform data for the channels to -1. Failing to do so will result inadvertent match in the filter function because 0 is a valid channel number.

Applied, thanks.