Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4347917rwd; Sat, 17 Jun 2023 11:45:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7JgFCEhomprrTEOxxFPtAUvuY4GL0SEcmkC60loXJOW/PhWpK0hDK98n/oTlwVhKYPYqQ2 X-Received: by 2002:a05:6870:6182:b0:1a6:a89b:d8f4 with SMTP id a2-20020a056870618200b001a6a89bd8f4mr2631067oah.47.1687027538048; Sat, 17 Jun 2023 11:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687027538; cv=none; d=google.com; s=arc-20160816; b=DAleySJSrLMZht7qCeBRMJ0mUECrKcokqSIKkKnEnoiNolH1g0vdJI9gMf5ckTli/P 0BLv48HBeZ6Q/nhIC4/LKWrNRcM0Sdivs7ffpzkX5nrxY/MzbTLM8jPI7uoLOqUq3UOn Fj9tgjUskoF77zkov+RL19WiLsI2LOGr/4PRH52VjsWuXidnn+NU+bljE6Wj0lff7B8C cOMm4i6sglrD+F/GAQOHs6I8PLZgSC4re8Bbi7AQ9geF6cjySqNh5BZIYe9Cgz7nwAjv bC+VFbONGi7ON87LjJMePetgeH9aQwtDN8QIqmAOUFQ3RqDm+kdWH4QyseNedsJl5Prx EyCA== 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=jDtRSmyrdEn4IUMeyITljDaLjHP2evzg6k4S0y8a2WI=; b=tQMD4BIl9YHnfDhSPcBzrLVefugmLJgW+UXgqiGPezQYEgpygGOhMCyUMF9enWRtWr 09dHoY9U8GDkPWehQ91ERYkk0O/kEXQ4A9D1h8xLjarrkzQISLBuWgRw28bkMDXLedrd xDaCs21hJ9uaSFjxZboFGJFjfwl3eS1olXjhVsBQ9efu9KlWRhm/lGiiG4eE87EoEgf0 5nsoFmcAGL2BLd4nNwjGnGPRruKmeRzUPpIcsQrR5W2HdE+SJJoRLbrH5WC5S981BAQE lpM/H7jHoP51IXRr9jENr6dO+c2aeNmaSsHHvZxryf9kddy5fHXosxT/TaApljj4/K5h YEqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tqa3vQSD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a63b910000000b00542b1792242si14455311pge.720.2023.06.17.11.45.24; Sat, 17 Jun 2023 11:45:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tqa3vQSD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1346429AbjFQSee (ORCPT + 99 others); Sat, 17 Jun 2023 14:34:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjFQSed (ORCPT ); Sat, 17 Jun 2023 14:34:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF031999; Sat, 17 Jun 2023 11:34:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88B9061041; Sat, 17 Jun 2023 18:34:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D5D6C433C8; Sat, 17 Jun 2023 18:34:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687026870; bh=fNMy7SXyBW1jCIm5hJ8n3QMFb+ZIzvFFSQPIRNswWnk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tqa3vQSDSBSwLbg1NACGJQo3XycU3FTUuMPoZgYoTP+tr4MFwRgw+7ekJhABlU23B lw9Gi1PIA3IMCPg5KUG8s4v7T5X7X0pJ93EEk2r+cIZp2xcKtW5VoU7fjPPU54/Gr7 zFsqwcuZjPDbUuFpeGcjgFPoMQDuJPYRrfrKYV3pi8s8O9PC/pfJvR8/boDX/5Kkvl tuxHyE3oXZJOi1BqV/go6QgU09spO1dKNagK184Kb2nYIAKhOHYRBVCKvYRfdLbYY9 ukmc77bal6Fu2foHWHkV/ldSMnfI2xT1iKrscCUvSN6vPf+ML3OsXBFBkmS/UsY7PZ va+skF5KzgJdQ== Date: Sat, 17 Jun 2023 19:34:23 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: "Paller, Kim Seer" , "lars@metafoo.de" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "Hennerich, Michael" , "robh@kernel.org" , "krzysztof.kozlowski@linaro.org" , "conor+dt@kernel.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v6 2/2] iio: adc: max14001: New driver Message-ID: <20230617193423.42a4d66c@jic23-huawei> In-Reply-To: References: <20230614004857.134980-1-kimseer.paller@analog.com> <20230614004857.134980-2-kimseer.paller@analog.com> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, 14 Jun 2023 14:53:12 +0300 Andy Shevchenko wrote: > On Wed, Jun 14, 2023 at 1:43=E2=80=AFPM Paller, Kim Seer > wrote: > > > From: Andy Shevchenko > > > Sent: Wednesday, June 14, 2023 5:12 PM =20 >=20 > ... >=20 > > > > + /* select external voltage reference source for the= ADC */ > > > > + ret =3D max14001_reg_update(st, MAX14001_CFG, > > > > + MAX14001_CFG_EXRF, 1); > > > > + > > > > + ret =3D regulator_get_voltage(vref); > > > > + if (ret < 0) > > > > + return dev_err_probe(dev, ret, > > > > + "Failed to get vref\n"= ); =20 > > > > > > Is it important to choose the external reference source _before_ gett= ing the > > > voltage of the regulator? If not, I would swap these calls, otherwise= the > > > comment is needed to explain why the sequence is important in the way= it's > > > written. =20 > > > > It is not important. These calls can be swap without any issues. =20 >=20 > If you send a new version, please swap, otherwise I hope Jonathan can > do it when applying. >=20 I made these changes whilst applying... --- a/drivers/iio/adc/max14001.c +++ b/drivers/iio/adc/max14001.c @@ -290,16 +290,19 @@ static int max14001_probe(struct spi_device *spi) if (ret) return ret; =20 - /* select external voltage reference source for the ADC */ - ret =3D max14001_reg_update(st, MAX14001_CFG, - MAX14001_CFG_EXRF, 1); - ret =3D regulator_get_voltage(vref); if (ret < 0) return dev_err_probe(dev, ret, "Failed to get vref\n"); =20 st->vref_mv =3D ret / 1000; + + /* select external voltage reference source for the ADC */ + ret =3D max14001_reg_update(st, MAX14001_CFG, + MAX14001_CFG_EXRF, 1); + + if (ret < 0) + return ret; } =20 mutex_init(&st->lock); Note that whilst I've applied this to the togreg branch of iio.git - it is = just a tiny bit too late to make the merge window that starts in about a week. As such I'll only push this out as testing until I can rebase the tree on rc1 once available. Thanks, Jonathan