From patchwork Tue Dec 17 11:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181863 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp5564319och; Tue, 17 Dec 2019 03:27:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzeZ2mLYwHMrRHmhsRwTHTCyX0wqTztiF9s171ZU1ks6CEJi9clhRvB5wvvywCr37Emy7fP X-Received: by 2002:a9d:24e8:: with SMTP id z95mr5601570ota.5.1576582075550; Tue, 17 Dec 2019 03:27:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576582075; cv=none; d=google.com; s=arc-20160816; b=HK69+ZqDoclxrSGQVZamP+vxRyrhWNXumgnuPE+wv9+nuxJ8Pqx+VDT/WSDeTpfdkc XKlIWAC/DL5moW//pRPVQ/yUkrHPnrqBJIELhbfreWplAFeRTvxCuZyy58YrBdRiCUKN hCfGXNO3l6uXu1QUhcUx2sV5EfXU9hwu+8HwMggMInROr3oshhA4ycbJTSzHxYWDRrz3 Z0JCI1PpyRekvqtneyribzzm7a/uOD1tcTEJRX1cSuR7xo9nsFrFDcpK9SgDg0MWK5Bg Q0RClAXr46WYn0p+Y7IRPax6KPTtw9p8DPpbShNNBsGUUEyURqVwbgz+PhylqCho+6L5 lhXw== 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=oFT2vKaK/f9ASvdOK2ke2gYmYaB30b49K4lQJ8g+btU=; b=uy8YNrEwspJmeyr+FItqjNKftISqnjCYPvC3WLp6coPSm0BS6jjyHTLokBwrmCZClG Z5NPBdSZafn2GZ6AUQ3bCytojaSlczbySxBSjtrWEILAbUkRXBMdHGf/Eij0OCOQlgWh cDKeFriM5xQuXjg2b+cw57IruGBoZB1sWgOIUZHtFcR8OxW3nYo3DJAHWBDq70dIjrll 2/9uAMMGNikgClk0FQdbJ71nytLyg8p+Bduw9li2xzzfb7gCBESEKkpGD3sOn9Ld9zxf 7EQcqM+KJ9wiWt07j5fnR3j2Vz5cm31pMLAxUOVtg/ds0L+qnPrOrGPA4Ql8fMWUlE0S DdKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tnFIA5jb; 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 o25si11537410oic.63.2019.12.17.03.27.55; Tue, 17 Dec 2019 03:27:55 -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=tnFIA5jb; 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 S1726859AbfLQL1y (ORCPT + 5 others); Tue, 17 Dec 2019 06:27:54 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:39476 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbfLQL1y (ORCPT ); Tue, 17 Dec 2019 06:27:54 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBHBRqda070976; Tue, 17 Dec 2019 05:27:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576582072; bh=oFT2vKaK/f9ASvdOK2ke2gYmYaB30b49K4lQJ8g+btU=; h=From:To:CC:Subject:Date; b=tnFIA5jbEh1gN1a2eL0w9MR3q5VhCmgRO6fA9Zq6xWIzmSjSyP3xZ6q8lrpU0HsDw ZGJHhF8IdMk/aT1T1FXrZlX4vQTGNDO5M0kJ03Fo1uBHJ26Hr+JOIdv87p72Y1Q38V kFXtxPU+c71rcdYlky6g6eKkt2vXVoVLdJk8qLk4= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBHBRqao117370 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Dec 2019 05:27:52 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE106.ent.ti.com (10.64.6.27) 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 05:27:50 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE110.ent.ti.com (10.64.6.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 05:27:50 -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 xBHBRmNu083008; Tue, 17 Dec 2019 05:27:49 -0600 From: Peter Ujfalusi To: CC: , , Subject: [PATCH] mmc: mxcmmc: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 13:28:03 +0200 Message-ID: <20191217112803.31161-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 --- drivers/mmc/host/mxcmmc.c | 11 ++++++++++- 1 file changed, 10 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/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 011b59a3602e..b3d654c688e5 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -1121,7 +1121,16 @@ static int mxcmci_probe(struct platform_device *pdev) mxcmci_writel(host, host->default_irq_mask, MMC_REG_INT_CNTR); if (!host->pdata) { - host->dma = dma_request_slave_channel(&pdev->dev, "rx-tx"); + host->dma = dma_request_chan(&pdev->dev, "rx-tx"); + if (IS_ERR(host->dma)) { + if (PTR_ERR(host->dma) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto out_clk_put; + } + + /* Ignore errors to fall back to PIO mode */ + host->dma = NULL; + } } else { res = platform_get_resource(pdev, IORESOURCE_DMA, 0); if (res) {