Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6552950ybl; Mon, 23 Dec 2019 07:43:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwjCICq02uL6tx1cGbnam6hCVoyYAnJdFCR4EFhU8OpEO9UBpufAekX2D3zaAw6YjCY7eGd X-Received: by 2002:a05:6830:3c2:: with SMTP id p2mr11053113otc.213.1577115806745; Mon, 23 Dec 2019 07:43:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577115806; cv=none; d=google.com; s=arc-20160816; b=Hq+s4QhCHgAZxiJZT8hTOudqHMAKL+MkCCIt0qpJ8EDW24e2diJ7WcpYym23Kqh2wo YWs0zoTYeZ8Gu05jNY4TpecAG2aqoHbS1U6iLuHtKW61fXiRA02/k2LZe3bGG07eqEIp uJ8u3JFEH8jZ1BynUt9UF9ND+LqiyeDEdV19lG/B458MBPpsIlSh/wC9d/bifBWw5hlK NA+WXsxe6ge32a5YyDJ7Cc33zRVwOXi1ZifVBYA96cb3yygOjw6TX5pnTMGGALApCn6u eV+oKMbqNHNfXMsjxXT+wW5S4+K4Rf0e3uHeagwL18Lv7rtxQoHrHYSqf/zhHeijaKJ9 xEZg== 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:subject:cc:to:from:date :dkim-signature; bh=fcbuuWsq2CHUxH/l3paADZMkxIwLM9i7MAS9ZhzD49A=; b=YPdZOffkdCSvvVMBkTgsHmYSPZiw2GZlyOTDg48NoQnui56Mroo0zHrF3mo6RcdS96 OOtj5UB3gPNMeciVArUo17C29DsidYoCEwrDmlwGF2vdH9tmcHD5LXx/Ijjzfivr0huD ZsunMLiKxFjAzErbf5XSyMDMBdGvQo3L3fdjQf4pHBFdjyqYaUoJAJ8cLq47I+MW8LW4 t1v5z2zShLX9weZHKBMFFSD+IGPvbSbHBCcwIfSf4l1L76X2e+1hXBUWNu8izUm1EeUc WoSndSxwwTP0iiOrAOkHEN0QNtDDx9dOBPMUaBk352gJ0jkSv0ye7jUt3O0neiruTY64 t3Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s//tC+nT"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si10885370otn.232.2019.12.23.07.43.14; Mon, 23 Dec 2019 07:43:26 -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=@kernel.org header.s=default header.b="s//tC+nT"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbfLWPmg (ORCPT + 99 others); Mon, 23 Dec 2019 10:42:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:42416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbfLWPmf (ORCPT ); Mon, 23 Dec 2019 10:42:35 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BE0520409; Mon, 23 Dec 2019 15:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577115754; bh=W7dVTbz3atfdVAhEErfOc/0Hk/lMKKZVb4bYQnWDj2A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=s//tC+nTdBusmIDHh3w/JHuWKUr8WZVN0KLC+5/wqYR78n9MAxMnp6XKUU4AC657c U14znr1zujKNxf6wQUO+8FMnp7RkFlmi3LhRux36l3jmUeE1S5MfamQvscwQPE3N9f V1cD1j/T75J6/4t7OPNogFXjcHgnMBW3Nc+c3bpQ= Date: Mon, 23 Dec 2019 15:42:30 +0000 From: Jonathan Cameron To: Peter Ujfalusi Cc: , , , , , , , Fabrice Gasnier Subject: Re: [PATCH] iio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel() Message-ID: <20191223154230.7fb2a988@archlinux> In-Reply-To: <20191217075153.23766-1-peter.ujfalusi@ti.com> References: <20191217075153.23766-1-peter.ujfalusi@ti.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 17 Dec 2019 09:51:53 +0200 Peter Ujfalusi wrote: > 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 Peter, Change looks sensible to me, but I'd like to leave a little longer for others to look at this. Give me a poke if I seem to have lost it by the end of the first week in Jan. Thanks, Jonathan > --- > drivers/iio/adc/stm32-adc.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c > index 3b291d72701c..5dab23f1fdee 100644 > --- a/drivers/iio/adc/stm32-adc.c > +++ b/drivers/iio/adc/stm32-adc.c > @@ -1746,9 +1746,15 @@ static int stm32_adc_dma_request(struct iio_dev *indio_dev) > struct dma_slave_config config; > int ret; > > - adc->dma_chan = dma_request_slave_channel(&indio_dev->dev, "rx"); > - if (!adc->dma_chan) > + adc->dma_chan = dma_request_chan(&indio_dev->dev, "rx"); > + if (IS_ERR(adc->dma_chan)) { > + if (PTR_ERR(adc->dma_chan) == -EPROBE_DEFER) > + return -EPROBE_DEFER; > + > + /* Ignore errors to fall back to IRQ mode */ > + adc->dma_chan = NULL; > return 0; > + } > > adc->rx_buf = dma_alloc_coherent(adc->dma_chan->device->dev, > STM32_DMA_BUFFER_SIZE,