lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251227-s2mpg1x-regulators-v5-21-0c04b360b4c9@linaro.org>
Date: Sat, 27 Dec 2025 12:24:43 +0000
From: André Draszik <andre.draszik@...aro.org>
To: Tudor Ambarus <tudor.ambarus@...aro.org>, Rob Herring <robh@...nel.org>, 
 Conor Dooley <conor+dt@...nel.org>, Krzysztof Kozlowski <krzk@...nel.org>, 
 Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Lee Jones <lee@...nel.org>, Linus Walleij <linus.walleij@...aro.org>, 
 Bartosz Golaszewski <brgl@...ev.pl>, 
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Linus Walleij <linusw@...nel.org>, 
 Bartosz Golaszewski <brgl@...nel.org>
Cc: Peter Griffin <peter.griffin@...aro.org>, 
 Will McVicker <willmcvicker@...gle.com>, Juan Yescas <jyescas@...gle.com>, 
 kernel-team@...roid.com, linux-kernel@...r.kernel.org, 
 linux-samsung-soc@...r.kernel.org, devicetree@...r.kernel.org, 
 linux-gpio@...r.kernel.org, 
 André Draszik <andre.draszik@...aro.org>
Subject: [PATCH v5 21/21] regulator: s2mps11: enable-gpios is optional on
 s2mpg1x

For s2mpg1x, enable-gpios is optional, but when not given, the driver
is complaining quite verbosely about the missing property.

Refactor the code slightly to avoid printing those messages to the
kernel log in that case.

Signed-off-by: André Draszik <andre.draszik@...aro.org>
---
 drivers/regulator/s2mps11.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 178a032c0dc192874118906aee45441a1bbd8515..2d5510acd0780ab6f9296c48ddcde5efe15ff488 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -352,7 +352,7 @@ static int s2mps11_regulator_set_suspend_disable(struct regulator_dev *rdev)
 }
 
 static int s2mps11_of_parse_gpiod(struct device_node *np,
-				  const char *con_id,
+				  const char *con_id, bool optional,
 				  const struct regulator_desc *desc,
 				  struct regulator_config *config)
 {
@@ -371,14 +371,19 @@ static int s2mps11_of_parse_gpiod(struct device_node *np,
 		if (ret == -EPROBE_DEFER)
 			return ret;
 
-		if (ret == -ENOENT)
+		if (ret == -ENOENT) {
+			if (optional)
+				return 0;
+
 			dev_info(config->dev,
 				 "No entry for control GPIO for %d/%s in node %pOF\n",
 				 desc->id, desc->name, np);
-		else
+		} else {
 			dev_warn_probe(config->dev, ret,
 				       "Failed to get control GPIO for %d/%s in node %pOF\n",
 				       desc->id, desc->name, np);
+		}
+
 		return 0;
 	}
 
@@ -409,7 +414,8 @@ static int s2mps11_of_parse_cb(struct device_node *np,
 	else
 		return 0;
 
-	return s2mps11_of_parse_gpiod(np, "samsung,ext-control", desc, config);
+	return s2mps11_of_parse_gpiod(np, "samsung,ext-control", false, desc,
+				      config);
 }
 
 static int s2mpg10_of_parse_cb(struct device_node *np,
@@ -528,7 +534,7 @@ static int s2mpg10_of_parse_cb(struct device_node *np,
 
 	++s2mpg10_desc->desc.ops;
 
-	return s2mps11_of_parse_gpiod(np, "enable", desc, config);
+	return s2mps11_of_parse_gpiod(np, "enable", true, desc, config);
 }
 
 static int s2mpg10_enable_ext_control(struct s2mps11_info *s2mps11,

-- 
2.52.0.351.gbe84eed79e-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ