From patchwork Thu Dec 12 13:55:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181487 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp802490och; Thu, 12 Dec 2019 05:56:18 -0800 (PST) X-Google-Smtp-Source: APXvYqwjY6P8kLTJg+F0C1vUvY+nJrfI2uRB/5bFE4MvKOM99jAXf9lS421a/U8XPmCkerWi29bb X-Received: by 2002:a9d:4789:: with SMTP id b9mr7667892otf.247.1576158977934; Thu, 12 Dec 2019 05:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576158977; cv=none; d=google.com; s=arc-20160816; b=oCS5uXbye2aWV4CMoRSY03q0SirACEQzrZXPMlxe21pLR+D5l2H0bey6sABGZh14ac wXLyBSrlkzxF866oR6tAqK1zzQPTNTjBhRQ5egxsFY9GVSZj6wV695vRfgTU/B52cGng MQtyrnq+wGYtOH+Yk12uyZsXI+lXQ2jIpGpVFJ4jL7mMn/2diE4v1U/muq5uIwdPt2ON TGSZs5Q38jAn/PrRA8F9QUhKsIy1rJMqmEsmYIDJLNEZRf35bo/cHwy9cjCvbXgHfFbK iHPUYbfabVcjD8tlSxaw72dbG/tyES172/CAW/n8az5eEZ2WGJTAW/yYQmKulguaYTyW 6+sg== 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=Nf2gNb/jS/G6cUNn8sWiq6/8AS6dlAnuvnEznHwOdRM=; b=Q2l1OIB5mnWoCtmEF+qCDM9rU0MUcdkwjwqtRjVNZ7AmiHmgWQoMvn95irSln0ov7n uiGFEblND0VXuU6FkU1Sr+6Mmdgs+gwoYnuB5g/ZdZX6oSIItJ7yIFJOYQmdyMyi44kg SLONbXEJPa7Q7zFtVgDN5UKoYSfv+SnH6DBpejT3Bh/XoB2gTdHZQ/2rINvbPMqEgZgw RZUo86j7Dw5gCOJLuptSuvZePhRykvL7jaMqVwZHRN7YSQpXylPx9zf6FPsULvZxuXjc 83yS6uRW0pQvDlsmDKpZNgZNTUoNHuErdCwJylGhKHef2kWQ5TPCKQGObNgXUzXILdlF yxMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=k6uYh5bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r8si2890812otp.194.2019.12.12.05.56.17; Thu, 12 Dec 2019 05:56:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=k6uYh5bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729608AbfLLN4Q (ORCPT + 27 others); Thu, 12 Dec 2019 08:56:16 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:56958 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729583AbfLLN4N (ORCPT ); Thu, 12 Dec 2019 08:56:13 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBCDu0cx130447; Thu, 12 Dec 2019 07:56:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576158960; bh=Nf2gNb/jS/G6cUNn8sWiq6/8AS6dlAnuvnEznHwOdRM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=k6uYh5bU2/zzgvk7pRIgiuqGcu8mz94qs7oiyHD8Ih1TVnUuBzZR0/ZYEYBOLJvD3 XJeSkDnN29o+7pHzUZrULOcrPZZzPRix0f7nPfoUaU7u0oBzHz/PcxY6r1NFHfrijW JfD2AOjbCNWzyhkgJ82tPVSPrQBpJD3NkuEks8nE= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBCDu071116442; Thu, 12 Dec 2019 07:56:00 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE107.ent.ti.com (157.170.170.37) 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:55:59 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE111.ent.ti.com (157.170.170.22) 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:55:59 -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 xBCDtdqU048444; Thu, 12 Dec 2019 07:55:56 -0600 From: Peter Ujfalusi To: , , , , , , , , , CC: , , , , , Subject: [PATCH 4/9] spi: img-spfi: Use dma_request_chan() instead dma_request_slave_channel() Date: Thu, 12 Dec 2019 15:55:45 +0200 Message-ID: <20191212135550.4634-5-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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-img-spfi.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 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-img-spfi.c b/drivers/spi/spi-img-spfi.c index f4a8f470aecc..8543f5ed1099 100644 --- a/drivers/spi/spi-img-spfi.c +++ b/drivers/spi/spi-img-spfi.c @@ -666,8 +666,22 @@ static int img_spfi_probe(struct platform_device *pdev) master->unprepare_message = img_spfi_unprepare; master->handle_err = img_spfi_handle_err; - spfi->tx_ch = dma_request_slave_channel(spfi->dev, "tx"); - spfi->rx_ch = dma_request_slave_channel(spfi->dev, "rx"); + spfi->tx_ch = dma_request_chan(spfi->dev, "tx"); + if (IS_ERR(spfi->tx_ch)) { + ret = PTR_ERR(spfi->tx_ch); + spfi->tx_ch = NULL; + if (ret == -EPROBE_DEFER) + goto disable_pm; + } + + spfi->rx_ch = dma_request_chan(spfi->dev, "rx"); + if (IS_ERR(spfi->rx_ch)) { + ret = PTR_ERR(spfi->rx_ch); + spfi->rx_ch = NULL; + if (ret == -EPROBE_DEFER) + goto disable_pm; + } + if (!spfi->tx_ch || !spfi->rx_ch) { if (spfi->tx_ch) dma_release_channel(spfi->tx_ch);