From patchwork Tue Dec 17 12:22:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181884 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5671993ile; Tue, 17 Dec 2019 04:22:50 -0800 (PST) X-Google-Smtp-Source: APXvYqylBdT0faq08KuWADSDGIl0KOvyycVK8p2rz5JAW9wWix1vZIZ23lorm3MTpEc5Z0YcPKd3 X-Received: by 2002:a9d:4e97:: with SMTP id v23mr35611485otk.201.1576585370897; Tue, 17 Dec 2019 04:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576585370; cv=none; d=google.com; s=arc-20160816; b=J+hqs02tWjVl/arkwBEm5UUCRbc98S1Bzd2Wi4gxOwo1xIuMS/nH6iSE75ptSgufMd +G2hFsSUrbev0GlF7e3w4RBH/HA4oMgbs9jS2O3AL/QPbV+y+WblrZtmM5eH/Q7nrnO0 QkDUapCD8SEM6F7ZYxF+gs4+LjW1heUaK3ND+YiUMK1qTabtURx0JZQXlkOT4oOdWJNO yAFiFOI9Qt86Q8cj/VbTdJvonsObfMjjzCBUAr4OT7QDt/RbAJvNo9IXi4DgTkLeO6DJ EEpdDJOcyrnP2nfoVzCu3hzGVERlz9HWTEIAhw4Rp6D+HmSIQ8LqxDUjfLbtv6o+ndGI ubGg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=qM9xJdxmrDLNaME/gOYVTnReJwrGrvAeNa92VYltRFM=; b=MbCxBAE8k1Pm8MgTPlfSGY/CIAwkFkg5OSHHopLIxGToJbkgkCW7rdmsqenW2tNN3p wTUrcBmGvcAqsGGf5Am42O9Ohh1l36IA8CT2Jsxuck0gmGqfqeR9mYLbtI0DGgqmwBzM ZSIV+8MbqTL55iMMjpk4i8uAdw4G8Nc9b10v6bIiE+6fRGm/b71VCRVmapKx2odUakKt ozAH54JeM0fzGv2ciq2VedWWBikvBVGWyyRipuWPruXAyiiZuuWTRcp+16AabLFxGpo/ wEqCBt9cp4AJCu93ZR1k4FXkzPghFNOYQ9zgBE68tt2XTHVS3fm6N3u/lod6ygqa1NQg fQ2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bM70QIlp; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 g187si219909oib.194.2019.12.17.04.22.50; Tue, 17 Dec 2019 04:22:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=bM70QIlp; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 S1727437AbfLQMWu (ORCPT + 5 others); Tue, 17 Dec 2019 07:22:50 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:41264 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbfLQMWu (ORCPT ); Tue, 17 Dec 2019 07:22:50 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBHCMgIe018636; Tue, 17 Dec 2019 06:22:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576585362; bh=qM9xJdxmrDLNaME/gOYVTnReJwrGrvAeNa92VYltRFM=; h=From:To:CC:Subject:Date; b=bM70QIlptkcNkidobo0JsKJTMLt21guPkDWa1gj2BY6HTH+1KGrOAEr/fwTXy4xe/ rtwCTbOCi79rEhbnrtlKk76ZFwkUUSaEcSX1ISRsoX/bqY8KKw6FF46rXmAvVIHm3j 6+We98QHhTHmX/cwOhwWvnYfRARygw8FcETyZ3rs= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBHCMgmr017727 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Dec 2019 06:22:42 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) 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; Tue, 17 Dec 2019 06:22:42 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) 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 via Frontend Transport; Tue, 17 Dec 2019 06:22:42 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBHCMcZh054542; Tue, 17 Dec 2019 06:22:39 -0600 From: Peter Ujfalusi To: , , , , CC: , , , , , Subject: [PATCH v2] mmc: bcm2835: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 14:22:54 +0200 Message-ID: <20191217122254.7103-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 --- Hi, Changes since v1: - instead of returning jump to err: to free up resources Regards, Peter drivers/mmc/host/bcm2835.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 99f61fd2a658..c3d949847cbd 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -1393,7 +1393,17 @@ static int bcm2835_probe(struct platform_device *pdev) host->dma_chan = NULL; host->dma_desc = NULL; - host->dma_chan_rxtx = dma_request_slave_channel(dev, "rx-tx"); + host->dma_chan_rxtx = dma_request_chan(dev, "rx-tx"); + if (IS_ERR(host->dma_chan_rxtx)) { + ret = PTR_ERR(host->dma_chan_rxtx); + host->dma_chan_rxtx = NULL; + + if (ret == -EPROBE_DEFER) + goto err; + + /* Ignore errors to fall back to PIO mode */ + } + clk = devm_clk_get(dev, NULL); if (IS_ERR(clk)) {