[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220906083356.21067-11-farbere@amazon.com>
Date: Tue, 6 Sep 2022 08:33:45 +0000
From: Eliav Farber <farbere@...zon.com>
To: <jdelvare@...e.com>, <linux@...ck-us.net>, <robh+dt@...nel.org>,
<p.zabel@...gutronix.de>, <rtanwar@...linear.com>,
<linux-hwmon@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: <farbere@...zon.com>, <hhhawa@...zon.com>, <jonnyc@...zon.com>,
<andriy.shevchenko@...el.com>
Subject: [PATCH v4 10/21] hwmon: (mr75203) skip reset-control deassert for SOCs that don't support it
Don't fail the probe function and don't deassert the reset controller if
a "reset" property doesn't exist in the device tree.
Change is done for SOCs that don't support a reset controller.
Signed-off-by: Eliav Farber <farbere@...zon.com>
---
V3 -> v2:
- Change "reset" property to be optional instead of skipping it.
drivers/hwmon/mr75203.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 5f2b11a2bf5f..c94e89c94cb3 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -541,14 +541,17 @@ static int mr75203_probe(struct platform_device *pdev)
return ret;
}
- pvt->rst = devm_reset_control_get_exclusive(dev, NULL);
+ pvt->rst = devm_reset_control_get_optional_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");
+ if (pvt->rst) {
+ 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