Re: [PATCH] thermal: rcar_gen3_thermal: Register hwmon sysfs interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux