From: Peter Korsgaard <jacmet@sunsite.dk>
To: avorontsov@ru.mvista.com, dbrownell@users.sourceforge.net,
galak@kernel.crashing.org, linuxppc-dev@ozlabs.org
Subject: [PATCHv2] spi_mpc8xxx: fix WARN_ON on remove after 4c1fba44296
Date: Thu, 7 Jan 2010 11:23:57 +0100 [thread overview]
Message-ID: <1262859837-11311-1-git-send-email-jacmet@sunsite.dk> (raw)
Commit 4c1fba44296 (Add support for QE DMA mode and CPM1/CPM2 chips)
added unconditional calls to _cpm_init() / _cpm_free() from
probe()/remove(), but only checked if we're actually using CPM mode
in _init(), causing the WARN_ON in mpc8xxx_spi_free_dummy_rx() for !CPM.
Fix it by adding the same check in _cpm_free() as well.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
drivers/spi/spi_mpc8xxx.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
Changes since v1:
Fix return statement, mpc8xxx_spi_cpm_free() has void return type.
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c
index 1fb2a6e..674e7a2 100644
--- a/drivers/spi/spi_mpc8xxx.c
+++ b/drivers/spi/spi_mpc8xxx.c
@@ -946,6 +946,9 @@ static void mpc8xxx_spi_cpm_free(struct mpc8xxx_spi *mspi)
{
struct device *dev = mspi->dev;
+ if (!(mspi->flags & SPI_CPM_MODE))
+ return;
+
dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE);
dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE);
cpm_muram_free(cpm_muram_offset(mspi->tx_bd));
--
1.6.5
next reply other threads:[~2010-01-07 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 10:23 Peter Korsgaard [this message]
2010-01-11 10:57 ` [PATCHv2] spi_mpc8xxx: fix WARN_ON on remove after 4c1fba44296 Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262859837-11311-1-git-send-email-jacmet@sunsite.dk \
--to=jacmet@sunsite.dk \
--cc=avorontsov@ru.mvista.com \
--cc=dbrownell@users.sourceforge.net \
--cc=galak@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).