atmel_spi: fix dmachain oops with DEBUG enabled
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Wed, 6 Feb 2008 09:38:13 +0000 (01:38 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:10 +0000 (10:41 -0800)
commit8bacb219018a52e6f02a3cff6a7badf102ddfc44
tree7e89a0346ce1694c32cf035c2badb2ff77db6a00
parent154443c72f47169ebcb3a7befbff0e934c49bff3
atmel_spi: fix dmachain oops with DEBUG enabled

In atmel_spi_next_xfer, xfer can be NULL because the next transfer may
already have been submitted to the PDC (using DMA chaining).  This can
cause an oops, since the debug message assumed it was never null.  The
fix changes how those debug messages are issued, ensuring that one is
issued each time a transfer is started instead of once per call.

Also, properly indent the "can this transfer be chained" test so it's
not hidden as if it were non-conditional code.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/atmel_spi.c