Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3355620rwi; Sun, 16 Oct 2022 09:24:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7p4ON0vOKZ8+tvV5AVfw7rTd4M4otgLJO4xQIxsWaLa19cFJTH7yQfN9uuxArQFLiNaAj3 X-Received: by 2002:a17:902:868b:b0:185:be8:b316 with SMTP id g11-20020a170902868b00b001850be8b316mr7644402plo.157.1665937466288; Sun, 16 Oct 2022 09:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665937466; cv=none; d=google.com; s=arc-20160816; b=cvc7cinMq4s6mjN58imcFqyTqqqy2Xhnaim37QovdrLhOWveJinHFS8vWTV3IRdJrH vTMV9UNiVnVLZIql4Wbb0Kr/j+gmgeiHhFMdfLB5Bv9epJhmNha/rMh4xvrODBztYEGr hA5CAsSn/LWZFDsQFz5Z7M7so9mAXRyFOfcnsSYYLHVfeFt3gJQw/oOda9mOuO7x9mZl b6vEyRCCYkyki+f71btbeJoXowTjkZWQ7CUDsVRlMDYa2mFH7lLwIHMJROls3xSUoQkN KSp8DsiqXyrsU5aXyDHembjaZP+vIPR7SDB5zK7eT7vzIKN4XLjqY075HYXPKRlg5dQY XpHA== 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=YnPCJnO5qVkKzox6x8ttAfSgQEKAwLAo3X6pNgmrBxo=; b=JSpg089EgwaaihjgP8zYsu9KmDft3l9QeScipj9tE7G6skfy0jjWaau+jxkS7mGOrd FpPNtx0g95oihX/IVMnXDcIp5zG0TVdTycbksH4M5tk60v93QAzlH7GR026s3U9IJD0j 2WKNetGrGZz+j4GZXsk8ziDrp9ebsWrB74ZVrLSa1YPXMP28ySej1EbJURTRNO/u8wPS yUp8DeeSItTpLUKmfoZHR6VDgbvwSKtxZcSMNAsSiu53xk1ZWcT9x+GQdsqNSOQYKxg+ Xu9+KUWkfEJxzRFbOEELojjAYrLclFFBc3rLCeNzdar0RFyVgZVlDw+aW3DNP4WvTUKI uVTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kh9L4nst; 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 oo3-20020a17090b1c8300b0020aec774f36si10094953pjb.90.2022.10.16.09.24.14; Sun, 16 Oct 2022 09:24:26 -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=kh9L4nst; 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 S229832AbiJPP7U (ORCPT + 99 others); Sun, 16 Oct 2022 11:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbiJPP7S (ORCPT ); Sun, 16 Oct 2022 11:59:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70BFD2EF47; Sun, 16 Oct 2022 08:59:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DD6B060B82; Sun, 16 Oct 2022 15:59:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CE73C433C1; Sun, 16 Oct 2022 15:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665935954; bh=FWGVnL8JUfeZAW/bYV21gjLyuQl9zuKBduitEbI6BCs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kh9L4nstHqwy+c7OVzQSn5Znex9117jL4cmsO2WD6wxAhx26wo82yTLfnFsPdVNJF G83nzAe7Js+e02ZiX2s/sgv+TvLXKQmyOJejyGX89wYowEQYabXAFXXNHYIkHqHB48 bpZLWBBSW61g1J8YhQb9fMGR04EVIlxLKXpRtK+pGuOXRdCqHCWFUxOO669mjs/VR5 2eNcFUfDv+R0ma5X5STtLESVLGuHCTdZT8F+DLCpPmvvFjSvGurs2cZMyuOjC6DmNV 2FdvNCP+eo/b7HQIssx59ZSFY7ivwYC5FeIxWSa9M1z5Dy5G7CT9XfGd+ZELE1d6hQ wi8fiF5oYAZqw== Date: Sun, 16 Oct 2022 16:59:40 +0100 From: Jonathan Cameron To: Matti Vaittinen Cc: Matti Vaittinen , Alexandru Tachici , Lars-Peter Clausen , Michael Hennerich , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 06/14] iio: ad7192: Simplify using devm_regulator_get_enable() Message-ID: <20221016165940.792e15a2@jic23-huawei> In-Reply-To: <9719c445c095d3d308e2fc9f4f93294f5806c41c.1660934107.git.mazziesaccount@gmail.com> References: <9719c445c095d3d308e2fc9f4f93294f5806c41c.1660934107.git.mazziesaccount@gmail.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; 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=-7.4 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 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 Fri, 19 Aug 2022 22:19:01 +0300 Matti Vaittinen wrote: > Use devm_regulator_get_enable() instead of open coded get, enable, > add-action-to-disable-at-detach - pattern. Also drop the seemingly unused > struct member 'dvdd'. > > Signed-off-by: Matti Vaittinen Now the required dependencies are upstream... Applied to the togreg branch of iio.git. Thanks, Jonathan > > --- > v2 => v3 > Split to own patch. > --- > drivers/iio/adc/ad7192.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c > index d71977be7d22..8a52c0dec3f9 100644 > --- a/drivers/iio/adc/ad7192.c > +++ b/drivers/iio/adc/ad7192.c > @@ -177,7 +177,6 @@ struct ad7192_chip_info { > struct ad7192_state { > const struct ad7192_chip_info *chip_info; > struct regulator *avdd; > - struct regulator *dvdd; > struct clk *mclk; > u16 int_vref_mv; > u32 fclk; > @@ -1015,19 +1014,9 @@ static int ad7192_probe(struct spi_device *spi) > if (ret) > return ret; > > - st->dvdd = devm_regulator_get(&spi->dev, "dvdd"); > - if (IS_ERR(st->dvdd)) > - return PTR_ERR(st->dvdd); > - > - ret = regulator_enable(st->dvdd); > - if (ret) { > - dev_err(&spi->dev, "Failed to enable specified DVdd supply\n"); > - return ret; > - } > - > - ret = devm_add_action_or_reset(&spi->dev, ad7192_reg_disable, st->dvdd); > + ret = devm_regulator_get_enable(&spi->dev, "dvdd"); > if (ret) > - return ret; > + return dev_err_probe(&spi->dev, ret, "Failed to enable specified DVdd supply\n"); > > ret = regulator_get_voltage(st->avdd); > if (ret < 0) {