hwmon: (mr75203) skip reset-control deassert for SOCs that don't support it
authorEliav Farber <farbere@amazon.com>
Thu, 8 Sep 2022 15:24:37 +0000 (15:24 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 19 Sep 2022 13:17:06 +0000 (06:17 -0700)
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>
drivers/hwmon/mr75203.c

index 9259779cc2dff92e6380d488d73fb133f50356f3..3cc359e33677828344a5698608146a8d86793af6 100644 (file)
@@ -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)