From patchwork Tue Dec 17 07:52:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 181842 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp5410907ile; Mon, 16 Dec 2019 23:52:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwsDD1CF22p+6FZF7btjPQ/cjERMUDEhLwsENIS4qypNPtX8O2bPIdOFTr9TmL1JLKPOXYG X-Received: by 2002:a9d:6e89:: with SMTP id a9mr34364239otr.38.1576569136873; Mon, 16 Dec 2019 23:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576569136; cv=none; d=google.com; s=arc-20160816; b=qyMF35876bsHuaPRVwklsdFuZGd9NDltnIfNuoibdvatyJkFps+TlPeET7D7Aw/Xwe CSrW+z6OcfN9kHXMEe3spd7HEN3DI0GpF+FMEDEXl7Z4LmClASb/fiqsI45G0MSvhJ2P ElfOoGW0A62BIEl/H+fkShnqfkIrUD8aG4BdfezBQBtIJuz7F2Cel2o7mYQzW7Tv7RQU KaQXmMTwHUoOjz/ufaVx4iF86jFQlYxl0fli+BntEk9M1pwZK8L9TlnWgj5ltpSJGuSC W79PIb0B5foCx5LkxVDCU1ruvhpAgiQAnxlcnAqIMoxhKKiQxXTij2K9wIBDbcCj4HS4 PrzA== 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=JVOtlzp4SCMmIRdgV0Dwkwtw1zBJBOLFQP857cg/zhQ=; b=b794xA0C37gte2p+AKv6whNnuhBnUK574ZPAepcXKWsYppZHGCKKPfvlCRc93ntoWD npHR/HsdKiWdFiSvNLAI9XPqH5vhtzd2rPUUd4dxUNO4C95kiIroDzzBf+aw/RyUNDgO 1cIJb2mZdc3JCMHxO0l59GxiJUkAz6t+KGEQPVtF3ZT6XF4IZJFfpQRHxGo+rB/XdQen k4yy90eQkJNdMSYIRJjg9mjxIHp9HE1duly5G5u46whXfSKvPbwideT54+6UkKHLjmg1 9iCCW5F93KngFbb9ZpXQbeaJv1fdv6ThJDluC50DGnsfZffQfKfSI8QnFghURpYJXfJ5 A9rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DQagl2Z9; 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 s126si11287422oib.84.2019.12.16.23.52.16; Mon, 16 Dec 2019 23:52:16 -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=DQagl2Z9; 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 S1726764AbfLQHwP (ORCPT + 27 others); Tue, 17 Dec 2019 02:52:15 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:53936 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfLQHwP (ORCPT ); Tue, 17 Dec 2019 02:52:15 -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 xBH7q8a8082887; Tue, 17 Dec 2019 01:52:08 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1576569128; bh=JVOtlzp4SCMmIRdgV0Dwkwtw1zBJBOLFQP857cg/zhQ=; h=From:To:CC:Subject:Date; b=DQagl2Z9mA1II7/LrIfOiy+kvnFSvq3LR3YTlC9lD84Uor6OTYU0zqJ5QNAkjXRS5 IqFGPMfHchR75vQ7BqWh0VTz+v6B76K3TtXcE1DJupzGuHCBVn16BaYcag7sw8h2k5 rGBNOjHJ1PoW29Y8SrgJfYWZE47i88SCielTyrJY= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBH7q8jP049798 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Dec 2019 01:52:08 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE103.ent.ti.com (10.64.6.24) 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 01:52:08 -0600 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE108.ent.ti.com (10.64.6.29) 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 01:52:08 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBH7q5MV115230; Tue, 17 Dec 2019 01:52:06 -0600 From: Peter Ujfalusi To: , , CC: , , , , Subject: [PATCH] iio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel() Date: Tue, 17 Dec 2019 09:52:21 +0200 Message-ID: <20191217075221.23895-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 --- drivers/iio/adc/stm32-dfsdm-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/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c index e493242c266e..3aac1a21f9d0 100644 --- a/drivers/iio/adc/stm32-dfsdm-adc.c +++ b/drivers/iio/adc/stm32-dfsdm-adc.c @@ -1383,9 +1383,9 @@ static int stm32_dfsdm_dma_request(struct iio_dev *indio_dev) { struct stm32_dfsdm_adc *adc = iio_priv(indio_dev); - adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx"); - if (!adc->dma_chan) - return -EINVAL; + adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); + if (IS_ERR(adc->dma_chan)) + return PTR_ERR(adc->dma_chan); adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev, DFSDM_DMA_BUFFER_SIZE,