mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match
@ 2014-01-13  9:17 Mika Westerberg
  2014-01-13 12:39 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2014-01-13  9:17 UTC (permalink / raw)
  To: linux-spi
  Cc: Eric Miao, Russell King, Haojian Zhuang, Mark Brown,
	linux-kernel, 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.

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

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/spi/spi-pxa2xx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 7765b1999537..cbc68848789d 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -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;
 }
-- 
1.8.5.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match
  2014-01-13  9:17 [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match Mika Westerberg
@ 2014-01-13 12:39 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-01-13 12:39 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-spi, Eric Miao, Russell King, Haojian Zhuang, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

On Mon, Jan 13, 2014 at 11:17:04AM +0200, Mika Westerberg wrote:
> 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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-13 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-13  9:17 [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match Mika Westerberg
2014-01-13 12:39 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®