diff options
author | Eliav Farber <farbere@amazon.com> | 2022-09-08 17:24:37 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-09-19 15:17:06 +0200 |
commit | 493372f5d3df9905087a2ce9f8b5a2dca5af889f (patch) | |
tree | 3d2b85919543b3ca838ac631a967e2fdaba99e46 /drivers/hwmon/mr75203.c | |
parent | dt-bindings: hwmon: (mr75203) change "resets" property to be optional (diff) | |
download | linux-493372f5d3df9905087a2ce9f8b5a2dca5af889f.tar.xz linux-493372f5d3df9905087a2ce9f8b5a2dca5af889f.zip |
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@amazon.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220908152449.35457-10-farbere@amazon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/mr75203.c')
-rw-r--r-- | drivers/hwmon/mr75203.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c index 9259779cc2df..3cc359e33677 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) |