linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match
@ 2014-01-13  9:17 Mika Westerberg
       [not found] ` <1389604624-8412-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2014-01-13  9:17 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA
  Cc: Eric Miao, Russell King, Haojian Zhuang, Mark Brown,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, 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-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match
       [not found] ` <1389604624-8412-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 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-u79uwXL29TY76Z2rM5mHXA, Eric Miao, Russell King,
	Haojian Zhuang, linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- 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:39 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
     [not found] ` <1389604624-8412-1-git-send-email-mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
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;
as well as URLs for NNTP newsgroup(s).