Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp357678lqh; Sat, 4 May 2024 04:25:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWbEC/3+7JPYLPX+bstIh5c+gfUZJw4Wgs5psXPzSB0StYw3Op6Irto0717Dz8rfUqRUaG8D2YSAyVStlJ6QWUwHSD+TsVuKn8jmE86Rw== X-Google-Smtp-Source: AGHT+IHbySvZJbWg/ltJs9ZLD9YWB9hBIRFLV+5WjtxaX7DBO5J6XTPS6K0tv1LtXFTP+lH6tQgd X-Received: by 2002:a17:906:27d3:b0:a57:2cef:89c0 with SMTP id k19-20020a17090627d300b00a572cef89c0mr3413388ejc.67.1714821927344; Sat, 04 May 2024 04:25:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714821927; cv=pass; d=google.com; s=arc-20160816; b=Z/yO+8NlcFQsP+fUx1x/oSu33wfxHU9RcWRUlJuNhP7UCm6s3cZwmNG5m8mYKHXZOn NJwygiNzde7WzhKLKu7Hqs16kW/TEtL7QokIoVhM4/PrbPTR0gb1/AwMkB/L+o+hY98I RSPLr4kt4LNl6U5fpIgcU+sxf55GCNfvoEDcdMvFvNgV7IVUP/IdChkF1jv9L6NIhKUw TJnIJA18r6BDqcP/XK5eE9Jpir3Fs8EY9T2oWmxlm+2kYFAjZ0yEUyJAFMO6P+Uku8ff 75KdK0Cu6R2RcDwWt8uASkN7F/zBxjufGlZn/aCP+r0XCnbnRKOmWzgoQXC/C1aQSi/8 CCow== 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=HkoHIgEc1TV+U1SMSFXCMbUVKf26G3cNOzbRVgy9aXs=; fh=3GFEJLvys4gaC8RnICAg+cyzm27rMx/z7q9rAZ8wFgs=; b=JqeB1WzmHXzAxtNkAJKqLWW670PK+YibXvOsqqKD7sM2Ajj+0pPKsgSrbE6a4piWE2 8M1ruuzYcybcRfRGG9ljDkAaoXrscy1EOScu/ZdC0A7LZcTHIk+MGHm4PJtdYP9wBjj3 Envg7JLMiKI+fqbAGk85Wsf7xBIR3ZAo0W0ArX4E1DUmWpX4vni6hyaL1HaZoQCeMRr8 Hj+gQsB1EUzTX46GbLT67F1qOpnhNBOAenn9dSDnlb9bjB6vbBIk+zPRnrHGI90kvU13 +g3TQHRFeTApFaeyrAgIvkMl+GY7bpU6+wbpUTEgqWWWD2dzgVLJNTjvhMbAiZPz79zJ 9eoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tu1gtAgG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168600-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hp28-20020a1709073e1c00b00a59afdfb9d3si237884ejc.590.2024.05.04.04.25.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 04:25:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tu1gtAgG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168600-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168600-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 17C141F21E98 for ; Sat, 4 May 2024 11:25:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4C781CD06; Sat, 4 May 2024 11:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tu1gtAgG" 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 BCE5A12E4A; Sat, 4 May 2024 11:25:17 +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=1714821917; cv=none; b=d3UEIneovagY0rH7uZ1slvSvtKoiRRdR+uuPvqCtnMc0/JoFkTAs5fOUYpemli7KjLh6XsQJ5qqyqOGGR9IFp/y99lVxdRTYPRY+YsydUnnjz3mvMk8/o6s8gkXm6R1kIQUYLjgCe7qXg97MoNAYIWhPTMONhSqFVh0JxHQmJh4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714821917; c=relaxed/simple; bh=aoXtElC6QjfEFEfzT5AfaOXZlXtAWDSJADrXTUPIhJ0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Iw+p2gYXchSk9PxM3LRIXLjEDaluYG0/MgZXGR39cLALH5fOXpj+WG45yctgD1+IBsFqyy7vk8xjz/asYAFgOGu7fo3d+TKm6sHE47fqDdMu7P9rpNoqtQo64Zsz6w8YNpz25KC0wxMu7ep74wpotNazKcF0uUCj0jBlHt/oHJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tu1gtAgG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C081C072AA; Sat, 4 May 2024 11:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714821917; bh=aoXtElC6QjfEFEfzT5AfaOXZlXtAWDSJADrXTUPIhJ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tu1gtAgG9z5Y+yIvIEIVmQ2fgyjD9Tn/RCv0n/DVuQsXojxeIcNqTROwRA0zGng4j Ya5SpoaGi4SNih9n8Sq3x2yfWbKEhYzBOqQZnSxnGf5l7dtD3PWZLGjvO1Ih20FJQD TReESyKIdZ7IsVIZsuw+P7sRyIFVtAbV56r6zgRm45YQ57ybcMMkFIXvmtn8AJNS7L SXuEjrVx4AQy13Z4yg9Rs4OpkuCPiiSzKbCIBkbCtfS15qjAPrPWQ8hxsqGMzicPgt RLgbpCGMpBjeLONT4v4OjIUqu4JFCpK+1qh829hJZmLNgsXGxStgLOER2GggkuhHv7 8TOSwx7Ys5crA== Date: Sat, 4 May 2024 12:25:04 +0100 From: Jonathan Cameron To: David Lechner Cc: Liam Girdwood , Mark Brown , Jean Delvare , Guenter Roeck , Dmitry Torokhov , Jonathan Corbet , Support Opensource , Cosmin Tanislav , Lars-Peter Clausen , Michael Hennerich , Antoniu Miclaus , Greg Kroah-Hartman , 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 v2 4/7] iio: addac: ad74115: Use devm_regulator_get_enable_read_voltage() Message-ID: <20240504122504.0389b872@jic23-huawei> In-Reply-To: <20240429-regulator-get-enable-get-votlage-v2-4-b1f11ab766c1@baylibre.com> References: <20240429-regulator-get-enable-get-votlage-v2-0-b1f11ab766c1@baylibre.com> <20240429-regulator-get-enable-get-votlage-v2-4-b1f11ab766c1@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 Mon, 29 Apr 2024 18:40:12 -0500 David Lechner wrote: > We can reduce boilerplate code by using > devm_regulator_get_enable_read_voltage(). > > To maintain backwards compatibility in the case a DT does not provide > an avdd-supply, we fall back to calling devm_regulator_get_enable() > so that there is no change in user-facing behavior (e.g. dummy regulator > will still be in sysfs). > > Also add an informative error message when we failed to get the voltage > and knowing the voltage is required while we are touching this. > > Signed-off-by: David Lechner A somewhat fiddly case. I think you've done it the best way possible though. Acked-by: Jonathan Cameron