Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp392736rdb; Thu, 5 Oct 2023 08:52:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcljwjV+1VdMPq1Mihj/+325m/14zlc4borxBwIVi4jRhTajLhHmEtxtRdfXJenCAkPBGR X-Received: by 2002:a17:90b:3810:b0:26f:ac36:623a with SMTP id mq16-20020a17090b381000b0026fac36623amr2521562pjb.3.1696521151186; Thu, 05 Oct 2023 08:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696521151; cv=none; d=google.com; s=arc-20160816; b=IlKbSpC8UrkAMRBJixK8Y05QKgkzAfOIdgfIuix0DkmuD5HodQ9qBpYPzGFujw8Qgb W0dBYh5YumPQeQhmGGI9Ul1ZjYA22Qh41ylZIIhaiQDvvkiAXca1gSCEftmdNmZDNJH3 7PRxEpsQLvwzFgCRN+Xcz38TSpGAeglPM8keeDW/iWeWtfmoDeQmXYjjjaLogS0KaJA3 +HjRfnNreGVxKAiL11k5o71+6VbBK91BrofnIoyWGxef4NcHYaVlEKbeZe/b5QGfZvx1 epsSXBy48gh+7+dNkLBPuKC/6iTI2T5pFo+i3VcIXyE2rbDs+0Q0hyGkbxzSrsEeevu2 80fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lc2FrJMEKxZghvf2kAcYqq+jKuAVqn1Y1zxiNY52xbg=; fh=b2i4pHMGHNOfybOHMuMVosWjf9I4wNhpIvzMuEvA4eE=; b=Sz6eOxdUSjFmw+RAhSmVIVU1+iEVllHvRkZew9r9ZePibwggPHNoj8SeB5j/ZGnVtM 0aMruXlTXnxcKMHa5wO9zcoQMiIPaRJnr3lEIXy7ur3lpnbaRZ/PVmW/kxIMo997NCKK SsRzmhVm8uWLifJcR+qHIPmELzVphLcfF/4k/HD9YFeCMikz9DSHTkWLrJoey4PHOWKc V8k2VFkH7WVO21abigL98AFGME9wpPaQm2h2t/i1yVSS7hYGRaSlJp78SC5iaJyhiptT UKOcOfu1oAKzebDJ/HZM1ZrwGG5Jz6bLpRkYnqTIsv58ZssSrXE2lfqN2sfO1Q6iAo2R vPtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q34l+jf/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r9-20020a17090a690900b002774985e8b7si4034341pjj.168.2023.10.05.08.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:52:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q34l+jf/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F27E582E7511; Thu, 5 Oct 2023 08:52:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234058AbjJEPwL (ORCPT + 99 others); Thu, 5 Oct 2023 11:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233998AbjJEPu6 (ORCPT ); Thu, 5 Oct 2023 11:50:58 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F38478A; Thu, 5 Oct 2023 07:09:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDDDEC433B7; Thu, 5 Oct 2023 14:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696514953; bh=k1FKWxeYnMbMWKz9v6DyRx1G4lOfFBO4olyVSlLtx5g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=q34l+jf/WhLuJLokRZRcE4VCOn4IptAUrPATBg6vJxDQdv4TSxJfLoUgqliV4QFka HPySTubr5L5yS+C6GTiEsRcnHl9yXvxeVN+z/ztCtPkRmHPJV6umSoGdeHVRBY0Tnd GRnlHbKCCO9+46xm5wEqozL6JEp16DKI6SeBast6baQxZ9xLf8dxscLwal/IAupnC+ lxWoKhqQK266ndBpaR314QpXA9WtRM2aW7IRgyRfzF5CLsdSo7tfJiR1MPfTnCZQ/g xtSwxA6wX0+5HauESPx/SxDzFodhqFPu8hYzFGK9JnqjjRg/hPtUx4NkzSzPh04YHK gzQ1TZP4OfhiQ== Date: Thu, 5 Oct 2023 15:09:17 +0100 From: Jonathan Cameron To: Wadim Egorov Cc: , , , , , , , , , Bhavya Kapoor Subject: Re: [PATCH v2] iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() Message-ID: <20231005150917.2d0c833e@jic23-huawei> In-Reply-To: <20230925134427.214556-1-w.egorov@phytec.de> References: <20230925134427.214556-1-w.egorov@phytec.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:52:30 -0700 (PDT) On Mon, 25 Sep 2023 15:44:27 +0200 Wadim Egorov wrote: > Fix wrong handling of a DMA request where the probing only failed > if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV > value is returned. This makes DMAs explicitly optional. Even if the > DMA request is unsuccessfully, the ADC can still work properly. > We do also handle the defer probe case by making use of dev_err_probe(). > > Fixes: f438b9da75eb ("drivers: iio: ti_am335x_adc: add dma support") > Signed-off-by: Wadim Egorov +CC Bhavya, Could you take a look at this given you had comments on v1. Thanks, Jonathan > --- > v2: > - Update description > - Drop line break after Fixes tag > - Move decision about optional DMA into probe/caller > --- > drivers/iio/adc/ti_am335x_adc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c > index 8db7a01cb5fb..5f8795986995 100644 > --- a/drivers/iio/adc/ti_am335x_adc.c > +++ b/drivers/iio/adc/ti_am335x_adc.c > @@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, indio_dev); > > err = tiadc_request_dma(pdev, adc_dev); > - if (err && err == -EPROBE_DEFER) > + if (err && err != -ENODEV) { > + dev_err_probe(&pdev->dev, err, "DMA request failed\n"); > goto err_dma; > + } > > return 0; >