linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Christian Lamparter <chunkeey@web.de>, Max Filippov <jcmvbkbc@gmail.com>
Subject: [PATCH 3/5] p54spi: return status of p54spi_wakeup
Date: Mon, 18 May 2009 03:02:33 +0400	[thread overview]
Message-ID: <1242601355-3178-4-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1242601355-3178-3-git-send-email-jcmvbkbc@gmail.com>

Return whether wakeup operation succeeded.
Make use of this return value.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 drivers/net/wireless/p54/p54spi.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 3991977..13566b1 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -311,7 +311,7 @@ static inline void p54spi_int_ack(struct p54s_priv *priv, u32 val)
 	p54spi_write32(priv, SPI_ADRS_HOST_INT_ACK, cpu_to_le32(val));
 }
 
-static void p54spi_wakeup(struct p54s_priv *priv)
+static int p54spi_wakeup(struct p54s_priv *priv)
 {
 	/* wake the chip */
 	p54spi_write32(priv, SPI_ADRS_ARM_INTERRUPTS,
@@ -321,13 +321,11 @@ static void p54spi_wakeup(struct p54s_priv *priv)
 	if (!p54spi_wait_bit(priv, SPI_ADRS_HOST_INTERRUPTS,
 			     cpu_to_le32(SPI_HOST_INT_READY))) {
 		dev_err(&priv->spi->dev, "INT_READY timeout\n");
-		goto out;
+		return -EBUSY;
 	}
 
 	p54spi_int_ack(priv, SPI_HOST_INT_READY);
-
-out:
-	return;
+	return 0;
 }
 
 static inline void p54spi_sleep(struct p54s_priv *priv)
@@ -360,7 +358,8 @@ static int p54spi_rx(struct p54s_priv *priv)
 	struct sk_buff *skb;
 	u16 len;
 
-	p54spi_wakeup(priv);
+	if (p54spi_wakeup(priv) < 0)
+		return -EBUSY;
 
 	/* dummy read to flush SPI DMA controller bug */
 	p54spi_read16(priv, SPI_ADRS_GEN_PURP_1);
@@ -411,7 +410,8 @@ static int p54spi_tx_frame(struct p54s_priv *priv, struct sk_buff *skb)
 	struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
 	int ret = 0;
 
-	p54spi_wakeup(priv);
+	if (p54spi_wakeup(priv) < 0)
+		return -EBUSY;
 
 	ret = p54spi_spi_write_dma(priv, hdr->req_id, skb->data, skb->len);
 	if (ret < 0)
-- 
1.6.0.6


  reply	other threads:[~2009-05-17 23:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0001-p54spi-fix-incorrect-access-sequence-to-DMA_WRITE_C.patch>
2009-05-17 23:02 ` [PATCH 0/5] p54spi: fixes to achieve link stability Max Filippov
2009-05-17 23:02   ` [PATCH 1/5] p54spi: fix incorrect access sequence to DMA_WRITE_CTRL in p54spi_spi_write_dma Max Filippov
2009-05-17 23:02     ` [PATCH 2/5] p54spi: cosmetic fixes: use even byte count in SPI write; drop unused interrupt status read Max Filippov
2009-05-17 23:02       ` Max Filippov [this message]
2009-05-17 23:02         ` [PATCH 4/5] p54spi: always call p54spi_sleep in p54spi_tx_frame if p54spi_wakeup succeeded Max Filippov
2009-05-17 23:02           ` [PATCH 5/5] p54spi: use firmware/DMA bug workaround that work under hight load in p54spi_rx Max Filippov
2009-05-18 18:53             ` Kalle Valo
2009-05-18 21:21               ` Max Filippov

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=1242601355-3178-4-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=chunkeey@web.de \
    --cc=linux-wireless@vger.kernel.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).