Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2878393lqt; Tue, 23 Apr 2024 04:40:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvLRO49XJbU6XNKEO1CTnVn9wkfjdPkXNh1sd/cY1bAiNz3ErbOT8QEDe1QlebWyA141a3gAfYggM+r/q6UPP1hhV1OojXBksAyEvLtw== X-Google-Smtp-Source: AGHT+IHP3Uoa5dDqamX3cEyu75dTIOAAb4qeGWrinNsJGMIBLcNA9/hc1PjG93IXPqc3QBQAnq6B X-Received: by 2002:a17:902:8b81:b0:1e2:a7bf:5172 with SMTP id ay1-20020a1709028b8100b001e2a7bf5172mr11353013plb.52.1713872448715; Tue, 23 Apr 2024 04:40:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713872448; cv=pass; d=google.com; s=arc-20160816; b=GvmJF7KiKouDHRKpowFTofMod2hWXx5V9fPDg2BwVDzp6A2RlA+sD1pX1+mewO2coc JZIKZhCNmKWSopqML08T+ZKGNPytEvZKExSR4m90eon/bhn9aYsYrEqY49bZu3i5y8oH zxeyYXTD/9uvwbl8Z+rqkoAg4n3mwwxfqF56AjnvANkVrmr1wm4lZr0J/PqNanV1Bdu7 AveEuHBz8r33cmNIyZ6oPo+NdCQFECtVOuh4AInSihz78V052fF675WAIZFMPiXuvoZ3 ET8mZQ0eUyb89maYusKPqrABVZUUCKXnqhfgsv218xL7CZPXD8RL0CFS8mEzuxbDjUTW nE6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=dK2K0Ec0XFCkUmGU77ZbWU+vJ4ynVXyD+Przas6R5LE=; fh=CyISknYNMBFw5QyYy53uWFb4+IoA04+GnufsIyWwu5o=; b=ejf629lMms/YBZz1fs+tMcoUPsJ+mYltFM6TcYJd8IX0c49Un9L2rhP4tUPnX9/FVQ 6IkU8B7+kpUVg2Qf9s/2wMxZEYzWeZsfXlJ0TQ2IQS8DZXFKujfQugFA6hj8n8IklrDZ EuAQ4I6EvtTPWNPE3V/osgaqwcvxfwA5MShzoYzSAa3ghNLdw6kn7xXpkDp41mQGei78 IOvQ3iVnKpSGuYeGfTPEBBaYWIjPaRX8Yt5pTtYA4Ne5RDdI7HbbuEgf4rI/9rwf9OxA txwBbFaTT+vh6H9ni6eNzq7191zKqZl5XSQV9GdIygUrBk7rDw7KXlx9kpThon0O34Q7 spCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Jeo845n8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-155005-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c18-20020a170902d49200b001e2a41b7569si9554204plg.83.2024.04.23.04.40.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 04:40:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155005-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=@gmail.com header.s=20230601 header.b=Jeo845n8; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-155005-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 5C436285AD5 for ; Tue, 23 Apr 2024 11:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2B4680020; Tue, 23 Apr 2024 11:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Jeo845n8" Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D57F7E58A for ; Tue, 23 Apr 2024 11:38:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713872320; cv=none; b=RmtS5eDQjsesmvBOAVP3usfOESjFIGrxzp4gvM+BPW0n6UdePR/HpWBcSw/PUBEN88amIagSdPZceEUYU74A2wMoVK6Mz58llX1ast0mNHyVaRye4caOC/3Gt5DcBjjpQL6PvViKHkiPA6yy6wpvKfnDytAMnLMJPUj4PQIgEWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713872320; c=relaxed/simple; bh=5snos77sT5IKCBiJqYMEMi6rYk+RsVOYEVFpg3CanSQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=I5ss8EuLs8f75HykBG0OX2czDJ0kODbi7uWhdc4DHcBiiW5DI4Y2jmjA3pbcCkp8UyMm+ovPY/5/v8jsZINvgrY5e6s3dUVl12xdHQkRSIo4UuC9v0NZaQHoNYjH1LwHLpkvBL8RDJAM+FlwtEw/aA/+QAqok+od64E2biN8838= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Jeo845n8; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-51ae315bb20so3956285e87.1 for ; Tue, 23 Apr 2024 04:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713872317; x=1714477117; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=dK2K0Ec0XFCkUmGU77ZbWU+vJ4ynVXyD+Przas6R5LE=; b=Jeo845n8KCZHb8QKv81btIbw1Gqy7fbT3mfyBFicLe7EBiby5zzuZF8PKvn0DBFIrY TpU1+fGx6p/q7adMJtU5OUvptqJ2NWFYgwEIXtKUugv+SchmoyhXgnzHjwpSL9ItCc2e 1bbgyk9mee6rIYDNckVC7UJ+MRvEJMeN8TqJxXZ1rpbzYvK4aWVWc662//PyjoiyWy+H 8JazI4oFDG9PIuc2XQ9RJU+tAD6iL8v1/0nwtwbg41waM7JWrmvJ5dY22WI2WGEH1B6a W9W7rBQ4wc4iZivQHdk1WPtgPHaPqFqOyZ5Ce6/V4sXXez9rggVOWUu218V0wnLvOIQv PYgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713872317; x=1714477117; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dK2K0Ec0XFCkUmGU77ZbWU+vJ4ynVXyD+Przas6R5LE=; b=bAZVWvKgr5Ssy0C4jqhfVIvoY9NGGy1ddxtuWwFK6oos+yDERz8yw3sOVUAJFuFlts gALqfuGxteZbzxPueDZN6RvTnN0LHwO5Vu5cAGlwOKNX8cGNLzUq/51d6f4IZ6KA7mCS 2NAv477JfASbNF+y+zI9aUVmZyPXZz76D9kffWNrBJGPNbzver2FQ3wz8Z72RSW1g+GN LZGxe/TJBod2+I116Ya3VtnJuEZkyD9orZ55VfvrAJahO9SvXhnDnr4my2NjeoGIYsWo xp5Xg/j1XpsFky3D/NvYPVy/Fo9iIln5ybpHTce9vAIsfYU9qg2xh95sOI9vU91JL2WR UDiw== X-Forwarded-Encrypted: i=1; AJvYcCUQwCluZXvWlcrwz/S/BWdjcMYlywCHmFNoIytwUUYx9hwW6g38Q2Azzm9DnaFwpIPUSiGsvjXIVzM3hcnUraxIf+IM7M6AM2tbW34w X-Gm-Message-State: AOJu0YzpcUbqfC4AdRh6ZQnGaH8DVH9PtmVm33jDuqYTe9/D/l7yqPhT yzuehMp7rvU3/7B0RA70R/+F/dxsCBJ7fKFf8MdsXpiaOqeCaV/c X-Received: by 2002:a19:8c5d:0:b0:51b:18a8:4cb1 with SMTP id i29-20020a198c5d000000b0051b18a84cb1mr4959810lfj.27.1713872317044; Tue, 23 Apr 2024 04:38:37 -0700 (PDT) Received: from fedora ([2a10:a5c0:800d:dd00:8cfe:d6e7:6701:9dfd]) by smtp.gmail.com with ESMTPSA id fc19-20020a056512139300b0051bbb93e7c3sm64393lfb.194.2024.04.23.04.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 04:38:36 -0700 (PDT) Date: Tue, 23 Apr 2024 14:38:28 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Aleksander Mazur , Guenter Roeck Subject: [PATCH] regulator: change devm_regulator_get_enable_optional() stub to return Ok Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="a/a7yYptJJkqZKWb" Content-Disposition: inline --a/a7yYptJJkqZKWb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The devm_regulator_get_enable_optional() should be a 'call and forget' API, meaning, when it is used to enable the regulators, the API does not provide a handle to do any further control of the regulators. It gives no real benefit to return an error from the stub if CONFIG_REGULATOR is not set. On the contrary, returning an error is causing problems to drivers when hardware is such it works out just fine with no regulator control. Returning an error forces drivers to specifically handle the case where CONFIG_REGULATOR is not set, making the mere existence of the stub questionalble. Change the stub implementation for the devm_regulator_get_enable_optional() to return Ok so drivers do not separately handle the case where the CONFIG_REGULATOR is not set. Signed-off-by: Matti Vaittinen Fixes: da279e6965b3 ("regulator: Add devm helpers for get and enable") --- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/c= onsumer.h index 71232fb7dda3..ed180ca419da 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -326,7 +326,7 @@ static inline int devm_regulator_get_enable(struct devi= ce *dev, const char *id) static inline int devm_regulator_get_enable_optional(struct device *dev, const char *id) { - return -ENODEV; + return 0; } =20 static inline struct regulator *__must_check base-commit: f7638784bd0cf2ca9daebd47477983811f832300 --=20 2.43.2 --=20 Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ Simon says - in Latin please. ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ Thanks to Simon Glass for the translation =3D]=20 --a/a7yYptJJkqZKWb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmYnna4ACgkQeFA3/03a ocX+qAgAiPOBscYJavats98gQBtIV6ZJc5p3lKHXLM8NTeSB5Tc/3RYVPvqzTd1r 0OGpl8SygzCIpGVTshB3PLoH/rieTtMzFsl6D3JqLj06HzeUsHGlBVKsIvDW4CCi APEPuDdOqnoGTY6j9U4Eo7tSUpa20lF7tTYdj4CabDadEucsve2MehDRA58KHB+O xYn0JbSTCNybSKFgSxYk27b57cRmQPTfhPhcM1k75Xevkb3GWw3RLTpGqy7IRLRY OJOaRpVHo31RXaVLtlnS2OPGrazd/W7AMpbObNWmPQ0kopiSfK27ORhwQWTehxEP 1Q+G+SD5CBOyvVJtcr+YYxrCN2evIA== =Z+IN -----END PGP SIGNATURE----- --a/a7yYptJJkqZKWb--