Re: [PATCH v2 02/14] thermal/core: Add a thermal sensor structure in the thermal zone

From: Geert Uytterhoeven
Date: Mon May 09 2022 - 05:50:39 EST


Hi Daniel,

On Sat, May 7, 2022 at 3:02 PM Daniel Lezcano <daniel.lezcano@xxxxxxxxxx> wrote:
> The thermal sensor ops is directly defined in the thermal zone but
> still its data structuration makes the sensor ops and the thermal zone
> too much interconnected for multiple sensors per thermal zone.
>
> Create a dedicated structure for the thermal sensor to be included in
> the thermal zone structure so these components are clearly separated.
>
> Cc: Alexandre Bailon <abailon@xxxxxxxxxxxx>
> Cc: Kevin Hilman <khilman@xxxxxxxxxxxx>
> Cc; Eduardo Valentin <eduval@xxxxxxxxxx>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>

Thanks for your patch!

> drivers/thermal/rcar_gen3_thermal.c | 6 +--

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -80,6 +80,11 @@ struct thermal_sensor_ops {
> void (*critical)(struct thermal_zone_device *);
> };
>
> +struct thermal_sensor {
> + struct thermal_sensor_ops *ops;
> + struct device *dev;

Unless I missed something, the "dev" field is unused in this series?

> +};
> +
> struct thermal_cooling_device_ops {
> int (*get_max_state) (struct thermal_cooling_device *, unsigned long *);
> int (*get_cur_state) (struct thermal_cooling_device *, unsigned long *);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds