thermal: airoha: fix wrong variable in AN7583 error check

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>
This commit is contained in:
Wayen Yan
2026-06-18 22:09:17 +02:00
committed by Jonas Jelonek
parent 6fde987711
commit 78f8876830
@@ -231,8 +231,8 @@ Signed-off-by: Christian Marangi <ansuelsmth@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;