]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
thermal: airoha: fix wrong variable in AN7583 error check 23781/head
authorWayen Yan <win847@gmail.com>
Sun, 14 Jun 2026 14:25:37 +0000 (22:25 +0800)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 18 Jun 2026 20:09:17 +0000 (22:09 +0200)
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>
target/linux/airoha/patches-6.18/402-05-thermal-drivers-airoha-Add-support-for-AN7583.patch

index 51332350ef7a121c614f6860c390a29fd969c740..dd7912259c32749bf532856a59c3b3cf6d800cae 100644 (file)
@@ -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;