[PATCH v2 05/16] hwmon: (mr75203) add option to skip reset controller
From: Eliav Farber
Date: Wed Aug 17 2022 - 01:45:12 EST
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@xxxxxxxxxx>
---
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