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: <20240411052257.2113-2-tony@atomide.com>
Date: Thu, 11 Apr 2024 08:22:54 +0300
From: Tony Lindgren <tony@...mide.com>
To: linux-omap@...r.kernel.org
Cc: Dhruva Gole <d-gole@...com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	linux-kernel@...r.kernel.org,
	linux-serial@...r.kernel.org
Subject: [RFC PATCH 1/4] reset: Fall back to lookup if no reset node is found

Fall back to lookup if the reset node does not exist. When creating and
removing subdevices on an interconnect, the parent device may provide
resets for the children using struct reset_control_lookup instead using
devicetree.

Signed-off-by: Tony Lindgren <tony@...mide.com>
---
 drivers/reset/core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/reset/core.c b/drivers/reset/core.c
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -1141,12 +1141,17 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id,
 					  int index, bool shared, bool optional,
 					  bool acquired)
 {
+	struct reset_control *rstc;
+
 	if (WARN_ON(shared && acquired))
 		return ERR_PTR(-EINVAL);
 
-	if (dev->of_node)
-		return __of_reset_control_get(dev->of_node, id, index, shared,
+	if (dev->of_node) {
+		rstc = __of_reset_control_get(dev->of_node, id, index, shared,
 					      optional, acquired);
+		if (!(IS_ERR(rstc) && PTR_ERR(rstc) == -ENOENT))
+			return rstc;
+	}
 
 	return __reset_control_get_from_lookup(dev, id, shared, optional,
 					       acquired);
-- 
2.44.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ