From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932942AbdABLgv (ORCPT ); Mon, 2 Jan 2017 06:36:51 -0500 Received: from mga02.intel.com ([134.134.136.20]:59703 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932535AbdABLgt (ORCPT ); Mon, 2 Jan 2017 06:36:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,432,1477983600"; d="scan'208";a="804271133" From: Andy Shevchenko To: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Thomas Petazzoni , linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2 3/6] staging: fbtft: fallback to usual allocation when DMA fails Date: Mon, 2 Jan 2017 13:35:31 +0200 Message-Id: <20170102113534.127692-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170102113534.127692-1-andriy.shevchenko@linux.intel.com> References: <20170102113534.127692-1-andriy.shevchenko@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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