From patchwork Thu Dec 12 13:55:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181489 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp802583och; Thu, 12 Dec 2019 05:56:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzOwjeGorCFvvSZxM7P1vjVf5jZzruQ8zEQCusihxkljzvvA+uXM/goHhRph4iMqyp2SAjX X-Received: by 2002:a9d:67c1:: with SMTP id c1mr7957748otn.20.1576158984249; Thu, 12 Dec 2019 05:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576158984; cv=none; d=google.com; s=arc-20160816; b=d9D8qNpzJ6JMBWjm1anHKdNsDS+6jMgxCvCfGWXsdy2H/aUzjZMkI+6oCagZ8ErAU0 ZS0l+MEzKRzMhRkndsJ1iNTmEyC04+5J55soOO6lIF4D3em8wkX8Lpz77q9AUdipU4N7 dp4Gw8uxezH1gay0hwlytDnx9V6jtwMlknwMISuaAr3uFRQrdX+yhGcUrvsGZ7ASJ+ih 1FgEG4Yi5ehMi3KdkPgwY/9l6kTkSljbCO/nYMsg+W4b2971LsOkHY10ZgkGlNHcogCL BUAmYv+GXAQ1mDBjcb945O/OdZ++nTjanzLFPEfS+gRYEyRGJjDwdeEC1HqeICfbRhVL D7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GwjOlZlkf6ym2bYHe7OPSGZdzZFvLSEucLjQjV/tniI=; b=b6ABWn8OsGQyPsIfy7MOlELJQTfchdEcUEi9atC4uqAGOo7C3qEFfJrRG4HpkU74XO ZNrAbK2hEdnYvmAmldEhcuf6JnupUeTvkbrMP4Un3Cd/2loZ7FyDivcqiWMfLR5/f8Ry /X/iNU0+A/xNxE3gi2ixXyG4lp50kc36CjTA5fAiiZnAOYKnLY9nDdUfO9eB/VRGPurB 1chYAB7Rga+kW6rej0tmN9BwzmDOu2MMJVH9aFgEe8LSdwAF6eU5kfg7Xm3spKEj06F9 IRfqptEQVF8oX7L5xSvy6Z5/XVn/4bSqbpN2yPyJx0FQL+WYB4zT+td+U8I7zbzRLTHx IBtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CC9SDJtb; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si3219490oth.29.2019.12.12.05.56.24; Thu, 12 Dec 2019 05:56:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CC9SDJtb; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729620AbfLLN4X (ORCPT + 2 others); Thu, 12 Dec 2019 08:56:23 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:36260 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729583AbfLLN4W (ORCPT ); Thu, 12 Dec 2019 08:56:22 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCDu8QH009011; Thu, 12 Dec 2019 07:56:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576158968; bh=GwjOlZlkf6ym2bYHe7OPSGZdzZFvLSEucLjQjV/tniI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=CC9SDJtbWZiGZQBVJseB8CQ0NVZ6Q9LHpzBSzFNua2TFwcL/SzNchz/it8h4YTj+W VyMw7QaqJcFLPr57HifJCnDfN5xkLfKoYCmZESqh6t/D05WlPZ5ulwMYlKKbIYi/CC BZBTMnSnuBTkZo4tn/V1nuKBgW9Y1n8+5IY/vKfg= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBCDu8LP044855 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Dec 2019 07:56:08 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 12 Dec 2019 07:56:07 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 12 Dec 2019 07:56:07 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCDtdqW048444; Thu, 12 Dec 2019 07:56:03 -0600 From: Peter Ujfalusi To: , , , , , , , , , CC: , , , , , Subject: [PATCH 6/9] spi: sirf: Use dma_request_chan() instead dma_request_slave_channel() Date: Thu, 12 Dec 2019 15:55:47 +0200 Message-ID: <20191212135550.4634-7-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191212135550.4634-1-peter.ujfalusi@ti.com> References: <20191212135550.4634-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org dma_request_slave_channel() is a wrapper on top of dma_request_chan() eating up the error code. By using dma_request_chan() directly the driver can support deferred probing against DMA. Signed-off-by: Peter Ujfalusi --- drivers/spi/spi-sirf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index e1e639191557..8419e6722e17 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -1126,16 +1126,16 @@ static int spi_sirfsoc_probe(struct platform_device *pdev) sspi->bitbang.master->dev.of_node = pdev->dev.of_node; /* request DMA channels */ - sspi->rx_chan = dma_request_slave_channel(&pdev->dev, "rx"); - if (!sspi->rx_chan) { + sspi->rx_chan = dma_request_chan(&pdev->dev, "rx"); + if (IS_ERR(sspi->rx_chan)) { dev_err(&pdev->dev, "can not allocate rx dma channel\n"); - ret = -ENODEV; + ret = PTR_ERR(sspi->rx_chan); goto free_master; } - sspi->tx_chan = dma_request_slave_channel(&pdev->dev, "tx"); - if (!sspi->tx_chan) { + sspi->tx_chan = dma_request_chan(&pdev->dev, "tx"); + if (IS_ERR(sspi->tx_chan)) { dev_err(&pdev->dev, "can not allocate tx dma channel\n"); - ret = -ENODEV; + ret = PTR_ERR(sspi->tx_chan); goto free_rx_dma; }