Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp456368lqh; Thu, 28 Mar 2024 07:06:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9lZBbLcIZhhGfnprjOvISAyBHrjoM8uRlGcW/AeLebjccP4zFTyCmsQ7NM8LiUNsbEWVoJZZTWIBDnGefSgmfdy7I1i0EX+08x5Fo+A== X-Google-Smtp-Source: AGHT+IE8WLZ6F8u0HfBj6spC15H4Zu8YDi2xlN2IERFvP/4DXpmqfZ/LKA1t4CVqO2Zpe1uQmBNq X-Received: by 2002:a17:90a:c385:b0:2a1:64a:bb63 with SMTP id h5-20020a17090ac38500b002a1064abb63mr3482424pjt.2.1711634776955; Thu, 28 Mar 2024 07:06:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711634776; cv=pass; d=google.com; s=arc-20160816; b=rrxuMYWH5//BI+ko1hpE0+/DshBnXZUzKttgGpV4mdsJq1yRP2BDnFdihJrWh64oHX riM2j3kIhamdPp4uvDBd+ppQTNOdBbkJWZM5d0gRFvltBgNfVvqMEiAcbTdEzyFmv08g 1OZQxEcQXj1w/xr5LglEHl/xTaDVCT9eRKp6H4P52WAAFdZhQ2qavHYXqXRCKsz5XyTH qFmcKzjBeJ/wP5rXvj+jJ6ZIgN8hDvoweUfOzUq3P3169ZsvVWvEtuU5RNJ2mE+EVV5g 84LMvQubKHCrAuQTiMV3iRThqYICeW5o1hWw4Nkj+pEWGfAhZSJqhwKsQhZ8VknwTVSz 0dtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Au4zwyd0vljsmkN6/S7bmfnHa4xFj30m9CxJPVFz1wk=; fh=NbtzYSGyln1NBy3dwjrRwMhypQlB/UwbJ7oBc05rlIE=; b=URiWXMy+0id9QLW/PtWpCS9no1tWS/7U3156SEu9kUjtq0AIq3vM7a0JV5aXP5Fe9l J8CeNnApzOZc1ZP/7XLt7Ue7MzACyTTiClDCdlb7ikEm8YGQ2X9kTI3Dl18K+j9QnY8U AEudL+MO3o0ZNyuSiefvLGSEhGVflVQTilH5AqJMLmki6DjT4JFAQrO0x3CLykiZM9R5 oeYT6dB7TN46Ez+AZufPL5C5qhZbje/qdG41CGKGgD7mm+td8xU258rvUp69Yz8A9oz+ RzP0SgeT/fBkEEZ9Kv9GizgdS4BW8OYtHWRmdEDbhJXF8ggshAWMhQpZW8Uc8XmbJXqg w03g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EynValxe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s18-20020a17090a441200b0029dd8953b07si1614480pjg.144.2024.03.28.07.06.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 07:06:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EynValxe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-123016-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id DD27B2998C9 for ; Thu, 28 Mar 2024 14:06:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F14E312A14C; Thu, 28 Mar 2024 14:05:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EynValxe" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0960682880; Thu, 28 Mar 2024 14:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634742; cv=none; b=V9n7CXzWm6GU6mUJ/ApU0nhfAcNlYWLu9AG2J0ipr+p+cN8jbyJxuZh4YxilNAISWYAIboCIuIJ5KT9E6ouLqYDBhcvOFiUY/ialivb+C3MeLRR2XUrbXnqcqnQA4ucBxPtyyhBYa35+4bkblUKl2ON/nMmQEVi/CEXmrXNprrQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634742; c=relaxed/simple; bh=EinO3RtbM3TdIgTBE67vxWObbXsICsHEkufTBzcRYss=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FTAjV1xw3s6g+gNU05kC5caPmCXwts2cOzRvJvqprW3+2PvyjtdoDtABe0o9a+3BxOgP1zWXgMwgROfK+FrKJYuXe08nIvhZSX6VNDhJkxFuw7B30SS6R1hBTT8d7hcXRN45uQswBCphsaG9TIN+uhDhHUDScaSJsD/RfVdCkNw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EynValxe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D80DC433C7; Thu, 28 Mar 2024 14:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711634741; bh=EinO3RtbM3TdIgTBE67vxWObbXsICsHEkufTBzcRYss=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EynValxen7HB5uREd61Y/MCiL3SKrBpIwIK+Odpq57OsuEHRPhKesevco8VnJuQUA ZnNRKgLy+fWHQaODETgdJXJ8q7vjEGZ/s0AH2Jw/NLurT1jnFSqpXEdBZOzTjkZajz ZZB+zXjdn61nbtrXvJwkGEMSaTUIV/RHQiOVeebhZPyS6B275LVVHfpLgzZN6ioyNk 4rgk43euFuglZCzHla+KzLQFI4zjgVTO33ICUepAihQY5yzrofLiF2S1ElC26sL5mn 7g2KMrhPBYDjVv3iBg2xcxWs7fCLE1K1VIf1NhRI1Jqy2O9iHkCIftuHveOC3kt4qA SNEgvjJ05Vuog== Date: Thu, 28 Mar 2024 14:05:25 +0000 From: Jonathan Cameron To: David Lechner Cc: Jonathan Corbet , Liam Girdwood , Mark Brown , Jean Delvare , Guenter Roeck , Support Opensource , Cosmin Tanislav , Lars-Peter Clausen , Michael Hennerich , Antoniu Miclaus , Greg Kroah-Hartman , Dmitry Torokhov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, linux-input@vger.kernel.org Subject: Re: [PATCH RFC 2/7] hwmon: (adc128d818) Use devm_regulator_get_optional_enable_get_voltage() Message-ID: <20240328140525.6364512e@jic23-huawei> In-Reply-To: <20240327-regulator-get-enable-get-votlage-v1-2-5f4517faa059@baylibre.com> References: <20240327-regulator-get-enable-get-votlage-v1-0-5f4517faa059@baylibre.com> <20240327-regulator-get-enable-get-votlage-v1-2-5f4517faa059@baylibre.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 27 Mar 2024 18:18:51 -0500 David Lechner wrote: > We can reduce boilerplate code and eliminate the driver remove() > function by using devm_regulator_get_optional_enable_get_voltage(). > > A new external_vref flag is added since we no longer have the handle > to the regulator to check if it is present. > > Signed-off-by: David Lechner One trivial thing. With that tidied up... Reviewed-by: Jonathan Cameron > hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, > data, adc128_groups); > if (IS_ERR(hwmon_dev)) { > err = PTR_ERR(hwmon_dev); > - goto error; > + return err; return PTR_ERR() > } > > return 0; > - > -error: > - if (data->regulator) > - regulator_disable(data->regulator); > - return err; > -}