From patchwork Sun Nov 1 14:41:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Bondarenko X-Patchwork-Id: 7532211 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7F8389F2F7 for ; Sun, 1 Nov 2015 14:42:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D57A206CD for ; Sun, 1 Nov 2015 14:42:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EDB1206BD for ; Sun, 1 Nov 2015 14:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbbKAOme (ORCPT ); Sun, 1 Nov 2015 09:42:34 -0500 Received: from mail-lb0-f179.google.com ([209.85.217.179]:36657 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752705AbbKAOlv (ORCPT ); Sun, 1 Nov 2015 09:41:51 -0500 Received: by lbjm5 with SMTP id m5so73480223lbj.3; Sun, 01 Nov 2015 06:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RMYgMBIpHcSnfjko2pRu3+bFkbU3kU9VfUUe5AhoFks=; b=V9c9uZdv9sjUkEOD7LcELljyl96SW6sBedXYqNPa4OiEnoLG29QKnuLbcjaDW3Mymc L+9yC2suiNIb7HLRr18LKs7uiMzuszjizboSzo5tSpn43BtOHsezDj6jsoUdrymsaEd2 m08aMCXssvVTyk39aviXHwao9pw3eGsFp8h7jDSTlpsFlCFCViV8NN3HBSmt8w+7i5Ib J0nGppTIZ6V2DwALPCCwMJV1NoQYHkvxZaVNk6vfjJLfJyitf7QcjE0p4cmxQ6tEL8Mh Ij7mLTBqfKBUnQPAYhKKalCYsHXr5DYOzn4IrqaeMqDa4Ge0SpXvk6MLJ1qiQuTso5PD 06pQ== X-Received: by 10.112.130.138 with SMTP id oe10mr2607328lbb.54.1446388909820; Sun, 01 Nov 2015 06:41:49 -0800 (PST) Received: from localhost.localdomain (c-89-233-200-205.cust.bredband2.com. [89.233.200.205]) by smtp.gmail.com with ESMTPSA id oy8sm3091607lbb.39.2015.11.01.06.41.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Nov 2015 06:41:49 -0800 (PST) From: Anton Bondarenko To: broonie@kernel.org, b38343@freescale.com Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, vladimir_zapolskiy@mentor.com, jiada_wang@mentor.com, s.hauer@pengutronix.de Subject: [PATCH v3 6/7] spi: imx: return error from dma channel request Date: Sun, 1 Nov 2015 15:41:40 +0100 Message-Id: <1446388901-6073-7-git-send-email-anton.bondarenko.sama@gmail.com> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1446388901-6073-1-git-send-email-anton.bondarenko.sama@gmail.com> References: <1446388901-6073-1-git-send-email-anton.bondarenko.sama@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anton Bondarenko On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index dc492e2..6035ddd 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -923,18 +923,20 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, spi_imx->wml = spi_imx_get_fifosize(spi_imx) / 2; /* Prepare for TX DMA: */ - master->dma_tx = dma_request_slave_channel(dev, "tx"); - if (!master->dma_tx) { - dev_err(dev, "cannot get the TX DMA channel!\n"); - ret = -EINVAL; + master->dma_tx = dma_request_slave_channel_reason(dev, "tx"); + if (IS_ERR(master->dma_tx)) { + dev_info(dev, "cannot get the TX DMA channel!\n"); + ret = PTR_ERR(master->dma_tx); + master->dma_tx = NULL; goto err; } /* Prepare for RX : */ - master->dma_rx = dma_request_slave_channel(dev, "rx"); - if (!master->dma_rx) { - dev_dbg(dev, "cannot get the DMA channel.\n"); - ret = -EINVAL; + master->dma_rx = dma_request_slave_channel_reason(dev, "rx"); + if (IS_ERR(master->dma_rx)) { + dev_info(dev, "cannot get the DMA channel.\n"); + ret = PTR_ERR(master->dma_rx); + master->dma_rx = NULL; goto err; }