In an7583_thermal_probe(), the code assigns priv->chip_scu from
device_node_to_regmap() but then checks IS_ERR(priv->map)
and returns PTR_ERR(priv->map). The variable priv->map is
not assigned in this function, so the error check uses a
different variable than what was actually assigned.
This should check chip_scu instead of map.
Fixes: 5891a9e5fbdf ("thermal/drivers: airoha: Add support for AN7583")
Signed-off-by: Wayen Yan <win847@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23781
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
+ int i;
+
+ priv->chip_scu = device_node_to_regmap(dev->parent->of_node);
-+ if (IS_ERR(priv->map))
-+ return PTR_ERR(priv->map);
++ if (IS_ERR(priv->chip_scu))
++ return PTR_ERR(priv->chip_scu);
+
+ for (i = 0; i < AIROHA_THERMAL_FIELD_MAX; i++) {
+ struct regmap_field *field;