[PATCH v2 3/6] staging: fbtft: fallback to usual allocation when DMA fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fall back to usual allocation method if DMA coherent allocation fails.

SPI framework will map and use DMA mapped memory when possible.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/staging/fbtft/fbtft-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 226be8c09768..9f024986aff4 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -843,7 +843,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
 		if (dma) {
 			txbuf = dmam_alloc_coherent(dev, txbuflen,
 						    &par->txbuf.dma, GFP_DMA);
-		} else
+		}
+		if (!txbuf)
 #endif
 		{
 			txbuf = devm_kzalloc(par->info->device,
-- 
2.11.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux