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: <20220817054321.6519-6-farbere@amazon.com>
Date:   Wed, 17 Aug 2022 05:43:10 +0000
From:   Eliav Farber <farbere@...zon.com>
To:     <jdelvare@...e.com>, <linux@...ck-us.net>, <robh+dt@...nel.org>,
        <mark.rutland@....com>, <linux-hwmon@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC:     <farbere@...zon.com>, <talel@...zon.com>, <hhhawa@...zon.com>,
        <jonnyc@...zon.com>, <hanochu@...zon.com>, <ronenk@...zon.com>,
        <itamark@...zon.com>, <shellykz@...zon.com>, <shorer@...zon.com>,
        <amitlavi@...zon.com>, <almogbs@...zon.com>, <dwmw@...zon.co.uk>,
        <rtanwar@...linear.com>
Subject: [PATCH v2 05/16] hwmon: (mr75203) add option to skip reset controller

Adding a "reset-control-skip" bool property to the mr75203 node will
avoid looking up and obtaining a reference to a reset controller.

Signed-off-by: Eliav Farber <farbere@...zon.com>
---
 drivers/hwmon/mr75203.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index f89f7bb5d698..bec63b611eb4 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -13,6 +13,7 @@
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/regmap.h>
@@ -525,14 +526,19 @@ static int mr75203_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	pvt->rst = devm_reset_control_get_exclusive(dev, NULL);
-	if (IS_ERR(pvt->rst))
-		return dev_err_probe(dev, PTR_ERR(pvt->rst),
-				     "failed to get reset control\n");
+	if (of_property_read_bool(dev->of_node, "reset-control-skip")) {
+		dev_info(dev, "skipping reset-control\n");
+	} else {
+		pvt->rst = devm_reset_control_get_exclusive(dev, NULL);
+		if (IS_ERR(pvt->rst))
+			return dev_err_probe(dev, PTR_ERR(pvt->rst),
+					     "failed to get reset control\n");
 
-	ret = pvt_reset_control_deassert(dev, pvt);
-	if (ret)
-		return dev_err_probe(dev, ret, "cannot deassert reset control\n");
+		ret = pvt_reset_control_deassert(dev, pvt);
+		if (ret)
+			return dev_err_probe(dev, ret,
+					     "cannot deassert reset control\n");
+	}
 
 	ret = regmap_read(pvt->c_map, PVT_IP_CONFIG, &val);
 	if(ret < 0)
-- 
2.37.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ