From patchwork Tue Dec 17 10:31:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181850 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp5502660och; Tue, 17 Dec 2019 02:31:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxVF4MdfsSyqytx/YgBz27HzEc5NiWEBSlW6zh1qZMYVz/qDLaSJ6ZBOtBMVsjKedp/7Lup X-Received: by 2002:a05:6830:1bf1:: with SMTP id k17mr36603413otb.101.1576578664501; Tue, 17 Dec 2019 02:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576578664; cv=none; d=google.com; s=arc-20160816; b=lxNti+uo1WAF4twdVzbZa9Ptsi+m6oUUsce0sREhCQGTbKBS5uWLJoGuVoZ4LoNLsl VgGAvuDC6eqVd7tyDCVHyipOKUBD9aXvCCsL5DMpVC5sX7jwfdEgY8FXhzmQbhYW0ccP rgppi52CdzAi09Z7xnNgOzJOfXuu3bRrMkU1uiiYFDiWQeWU5NoPkOHAXO3YrDmY+uF3 F6pla+Um4qLDgqNFz4XDDdOIMJBSWHxBmt5WGaclTPtuNsGlO33FI45zsNPfxvNDeIid 35YJfsxXVHtsF+33/CopvprYy8oyaEjm/jaxpMBBuy0gKoCNn+BM+tQoEtiaTp4fFrRh H+FA== 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=wn9on6RN9KiGYb9rI8S4DAOXkDSo3d7fRdwU9g+FaTA=; b=QdRL82wUH/J3YaDlrUggZx5L85wbcp6m+BEb9pUbyhJIAQOXDszEdnB9LSyEtJOdlE YWLXkixVvmauvBTfjqSicOb5pYXmrM9BTKKFQw/Rlohy9wx2Zr6YsGx/Ku0JtNr6Rpcp Lz+3tMWqm7SA6O1JG4kxsvdxlqZ91SG9dqHkCPwMuZG4rvKMmamLF9c8qNIep1udCToL Bqk0Qm1w4h/UvtSatxT+6t/Kbl/PHnEk/pHUh01kLZ65iG3KxMtkuQDWBs2EV1U2ovt4 8rUMlPE6TYuG3IZwmRnd7lM5uKyUdSPaJ9wBLtccmXRBtWaO/oe4lhBcge025BXkpvM3 Gp8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=x7sLPKbc; 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 x24si1027381oto.255.2019.12.17.02.31.04; Tue, 17 Dec 2019 02:31:04 -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=x7sLPKbc; 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 S1727152AbfLQKbC (ORCPT + 27 others); Tue, 17 Dec 2019 05:31:02 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:33598 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726191AbfLQKbB (ORCPT ); Tue, 17 Dec 2019 05:31:01 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBHAUm5u050488; Tue, 17 Dec 2019 04:30:48 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576578648; bh=wn9on6RN9KiGYb9rI8S4DAOXkDSo3d7fRdwU9g+FaTA=; h=From:To:CC:Subject:Date; b=x7sLPKbcxzPWH+usRT26UK5EUqUbEGPxt5+9yxa99u7YYP70x3Y4QNNcE1GJD+YCL WVcIaapLCfoK9Fb3JddvNT5XPQp2PipwghNDWKL3WjlEPZobdQ660nVyVqoF8D6+lJ xZk6P9Eq3j53FrOcvN8hpRxjeCMZJwO84tdq4Kc0= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBHAUmVR114748 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Dec 2019 04:30:48 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE100.ent.ti.com (10.64.6.21) 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 04:30:48 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) 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 04:30:48 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBHAUjHU114386; Tue, 17 Dec 2019 04:30:45 -0600 From: Peter Ujfalusi To: CC: , , , , , Subject: [PATCH v2] iio: adc: at91-sama5d2_adc: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 12:31:00 +0200 Message-ID: <20191217103100.21737-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-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 --- Hi, Changes since v1: - Subject prefix is corrected to "iio: adc: at91-sama5d2_adc:" Regards, Peter drivers/iio/adc/at91-sama5d2_adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c index e1850f3d5cf3..a5c7771227d5 100644 --- a/drivers/iio/adc/at91-sama5d2_adc.c +++ b/drivers/iio/adc/at91-sama5d2_adc.c @@ -1444,10 +1444,10 @@ static void at91_adc_dma_init(struct platform_device *pdev) if (st->dma_st.dma_chan) return; - st->dma_st.dma_chan = dma_request_slave_channel(&pdev->dev, "rx"); - - if (!st->dma_st.dma_chan) { + st->dma_st.dma_chan = dma_request_chan(&pdev->dev, "rx"); + if (IS_ERR(st->dma_st.dma_chan)) { dev_info(&pdev->dev, "can't get DMA channel\n"); + st->dma_st.dma_chan = NULL; goto dma_exit; }