> +static void rcar_gen3_hwmon_action(void *data)
> +{
> +     struct thermal_zone_device *zone = data;
> +
> +     thermal_remove_hwmon_sysfs(zone);
> +}
> +
>  static int rcar_gen3_thermal_probe(struct platform_device *pdev)
>  {
>       struct rcar_gen3_thermal_priv *priv;
> @@ -429,6 +437,17 @@ static int rcar_gen3_thermal_probe(struct 
> platform_device *pdev)
>               if (ret < 0)
>                       goto error_unregister;
>  
> +             tsc->zone->tzp->no_hwmon = false;
> +             ret = thermal_add_hwmon_sysfs(tsc->zone);
> +             if (ret)
> +                     goto error_unregister;
> +
> +             ret = devm_add_action(dev, rcar_gen3_hwmon_action, zone);
> +             if (ret) {
> +                     rcar_gen3_hwmon_action(zone);
> +                     goto error_unregister;
> +             }
> +
>               dev_info(dev, "TSC%d: Loaded %d trip points\n", i, ret);
>       }

This slipped through the cracks for me, I am sorry about that. I know it
is applied by now but I still wonder if the above functionality couldn't
be moved into the core as a generic helper? There is nothing R-Car
specific in here. From what I see it could be something like:

        devm_thermal_activate_hwmon_sysfs(dev, zone);

?

Attachment: signature.asc
Description: PGP signature

Reply via email to