aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2009-05-17 19:02:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:27 -0400
commit465b63537f93e82a2606332830801acb64467ec9 (patch)
treebaa7982839eb58726c26e6bb47a4a7c67531bb31 /drivers/net/wireless/p54
parent69712e926bad9c163d5ba5597f08084ee7902480 (diff)
p54spi: return status of p54spi_wakeup
Return whether wakeup operation succeeded. Make use of this return value. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54')
-rw-r--r--drivers/net/wireless/p54/p54spi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 399190b3bed7..5038e8aa9353 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -325,7 +325,7 @@ static inline void p54spi_int_ack(struct p54s_priv *priv, u32 val)
325 p54spi_write32(priv, SPI_ADRS_HOST_INT_ACK, cpu_to_le32(val)); 325 p54spi_write32(priv, SPI_ADRS_HOST_INT_ACK, cpu_to_le32(val));
326} 326}
327 327
328static void p54spi_wakeup(struct p54s_priv *priv) 328static int p54spi_wakeup(struct p54s_priv *priv)
329{ 329{
330 /* wake the chip */ 330 /* wake the chip */
331 p54spi_write32(priv, SPI_ADRS_ARM_INTERRUPTS, 331 p54spi_write32(priv, SPI_ADRS_ARM_INTERRUPTS,
@@ -335,13 +335,11 @@ static void p54spi_wakeup(struct p54s_priv *priv)
335 if (!p54spi_wait_bit(priv, SPI_ADRS_HOST_INTERRUPTS, 335 if (!p54spi_wait_bit(priv, SPI_ADRS_HOST_INTERRUPTS,
336 cpu_to_le32(SPI_HOST_INT_READY))) { 336 cpu_to_le32(SPI_HOST_INT_READY))) {
337 dev_err(&priv->spi->dev, "INT_READY timeout\n"); 337 dev_err(&priv->spi->dev, "INT_READY timeout\n");
338 goto out; 338 return -EBUSY;
339 } 339 }
340 340
341 p54spi_int_ack(priv, SPI_HOST_INT_READY); 341 p54spi_int_ack(priv, SPI_HOST_INT_READY);
342 342 return 0;
343out:
344 return;
345} 343}
346 344
347static inline void p54spi_sleep(struct p54s_priv *priv) 345static inline void p54spi_sleep(struct p54s_priv *priv)
@@ -374,7 +372,8 @@ static int p54spi_rx(struct p54s_priv *priv)
374 struct sk_buff *skb; 372 struct sk_buff *skb;
375 u16 len; 373 u16 len;
376 374
377 p54spi_wakeup(priv); 375 if (p54spi_wakeup(priv) < 0)
376 return -EBUSY;
378 377
379 /* dummy read to flush SPI DMA controller bug */ 378 /* dummy read to flush SPI DMA controller bug */
380 p54spi_read16(priv, SPI_ADRS_GEN_PURP_1); 379 p54spi_read16(priv, SPI_ADRS_GEN_PURP_1);
@@ -425,7 +424,8 @@ static int p54spi_tx_frame(struct p54s_priv *priv, struct sk_buff *skb)
425 struct p54_hdr *hdr = (struct p54_hdr *) skb->data; 424 struct p54_hdr *hdr = (struct p54_hdr *) skb->data;
426 int ret = 0; 425 int ret = 0;
427 426
428 p54spi_wakeup(priv); 427 if (p54spi_wakeup(priv) < 0)
428 return -EBUSY;
429 429
430 ret = p54spi_spi_write_dma(priv, hdr->req_id, skb->data, skb->len); 430 ret = p54spi_spi_write_dma(priv, hdr->req_id, skb->data, skb->len);
431 if (ret < 0) 431 if (ret < 0)