All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: pic32: Add a comment in pic32_spi_dma_prep()
@ 2019-11-26 13:50 Dan Carpenter
  2019-11-26 13:55 ` Peter Ujfalusi
  2019-11-26 14:02 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-11-26 13:50 UTC (permalink / raw)
  To: kernel-janitors

This code triggers a static checker warning about missed error codes.
It's slightly tricky that we fall back to PIO so let's silence the
checker and add a comment for anyone who is confused.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I won't feel offended at all if people don't think it's worth applying
this patch.

 drivers/spi/spi-pic32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index 156961b4ca86..835380ab8bf2 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -633,8 +633,10 @@ static int pic32_spi_dma_prep(struct pic32_spi *pic32s, struct device *dev)
 		goto out_err;
 	}
 
-	if (pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE))
+	if (pic32_spi_dma_config(pic32s, DMA_SLAVE_BUSWIDTH_1_BYTE)) {
+		ret = 0;  /* Fall back to PIO if DMA fails. */
 		goto out_err;
+	}
 
 	/* DMA chnls allocated and prepared */
 	set_bit(PIC32F_DMA_PREP, &pic32s->flags);
-- 
2.11.0

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

end of thread, other threads:[~2019-11-26 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-26 13:50 [PATCH] spi: pic32: Add a comment in pic32_spi_dma_prep() Dan Carpenter
2019-11-26 13:55 ` Peter Ujfalusi
2019-11-26 14:02 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.