* [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips()
[not found] <2211925.irdbgypaU6@rjwysocki.net>
@ 2024-07-29 16:11 ` Rafael J. Wysocki
2024-07-30 10:37 ` Niklas Söderlund
2024-08-02 9:55 ` Lukasz Luba
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2024-07-29 16:11 UTC (permalink / raw)
To: Linux PM
Cc: Daniel Lezcano, LKML, Lukasz Luba, Niklas Söderlund,
linux-renesas-soc
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
The only existing caller of thermal_zone_get_num_trips(), which is
rcar_gen3_thermal_probe(), uses this function to put the number of
trip points into a kernel log message, but this information is also
available from the thermal sysfs interface.
For this reason, remove the thermal_zone_get_num_trips() call from
rcar_gen3_thermal_probe() and drop the former altogether.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
A new version, based on the discussion following the v1:
https://lore.kernel.org/linux-pm/20240617183949.GO382677@ragnatech.se/
The Renesas driver change does not depend on the previous patches
in the series.
---
drivers/thermal/renesas/rcar_gen3_thermal.c | 6 +-----
drivers/thermal/thermal_trip.c | 6 ------
include/linux/thermal.h | 1 -
3 files changed, 1 insertion(+), 12 deletions(-)
Index: linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
===================================================================
--- linux-pm.orig/drivers/thermal/renesas/rcar_gen3_thermal.c
+++ linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
@@ -563,11 +563,7 @@ static int rcar_gen3_thermal_probe(struc
if (ret)
goto error_unregister;
- ret = thermal_zone_get_num_trips(tsc->zone);
- if (ret < 0)
- goto error_unregister;
-
- dev_info(dev, "Sensor %u: Loaded %d trip points\n", i, ret);
+ dev_info(dev, "Sensor %u: Loaded\n", i);
}
if (!priv->num_tscs) {
Index: linux-pm/drivers/thermal/thermal_trip.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_trip.c
+++ linux-pm/drivers/thermal/thermal_trip.c
@@ -55,12 +55,6 @@ int thermal_zone_for_each_trip(struct th
}
EXPORT_SYMBOL_GPL(thermal_zone_for_each_trip);
-int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
-{
- return tz->num_trips;
-}
-EXPORT_SYMBOL_GPL(thermal_zone_get_num_trips);
-
/**
* thermal_zone_set_trips - Computes the next trip points for the driver
* @tz: a pointer to a thermal zone device structure
Index: linux-pm/include/linux/thermal.h
===================================================================
--- linux-pm.orig/include/linux/thermal.h
+++ linux-pm/include/linux/thermal.h
@@ -210,7 +210,6 @@ int for_each_thermal_trip(struct thermal
int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
int (*cb)(struct thermal_trip *, void *),
void *data);
-int thermal_zone_get_num_trips(struct thermal_zone_device *tz);
void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
struct thermal_trip *trip, int temp);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips()
2024-07-29 16:11 ` [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips() Rafael J. Wysocki
@ 2024-07-30 10:37 ` Niklas Söderlund
2024-08-02 9:55 ` Lukasz Luba
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2024-07-30 10:37 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, Daniel Lezcano, LKML, Lukasz Luba, linux-renesas-soc
Hi Rafael,
Thanks for your work.
On 2024-07-29 18:11:29 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The only existing caller of thermal_zone_get_num_trips(), which is
> rcar_gen3_thermal_probe(), uses this function to put the number of
> trip points into a kernel log message, but this information is also
> available from the thermal sysfs interface.
>
> For this reason, remove the thermal_zone_get_num_trips() call from
> rcar_gen3_thermal_probe() and drop the former altogether.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>
> A new version, based on the discussion following the v1:
>
> https://lore.kernel.org/linux-pm/20240617183949.GO382677@ragnatech.se/
>
> The Renesas driver change does not depend on the previous patches
> in the series.
>
> ---
> drivers/thermal/renesas/rcar_gen3_thermal.c | 6 +-----
> drivers/thermal/thermal_trip.c | 6 ------
> include/linux/thermal.h | 1 -
> 3 files changed, 1 insertion(+), 12 deletions(-)
>
> Index: linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/renesas/rcar_gen3_thermal.c
> +++ linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
> @@ -563,11 +563,7 @@ static int rcar_gen3_thermal_probe(struc
> if (ret)
> goto error_unregister;
>
> - ret = thermal_zone_get_num_trips(tsc->zone);
> - if (ret < 0)
> - goto error_unregister;
> -
> - dev_info(dev, "Sensor %u: Loaded %d trip points\n", i, ret);
> + dev_info(dev, "Sensor %u: Loaded\n", i);
> }
>
> if (!priv->num_tscs) {
> Index: linux-pm/drivers/thermal/thermal_trip.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_trip.c
> +++ linux-pm/drivers/thermal/thermal_trip.c
> @@ -55,12 +55,6 @@ int thermal_zone_for_each_trip(struct th
> }
> EXPORT_SYMBOL_GPL(thermal_zone_for_each_trip);
>
> -int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
> -{
> - return tz->num_trips;
> -}
> -EXPORT_SYMBOL_GPL(thermal_zone_get_num_trips);
> -
> /**
> * thermal_zone_set_trips - Computes the next trip points for the driver
> * @tz: a pointer to a thermal zone device structure
> Index: linux-pm/include/linux/thermal.h
> ===================================================================
> --- linux-pm.orig/include/linux/thermal.h
> +++ linux-pm/include/linux/thermal.h
> @@ -210,7 +210,6 @@ int for_each_thermal_trip(struct thermal
> int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
> int (*cb)(struct thermal_trip *, void *),
> void *data);
> -int thermal_zone_get_num_trips(struct thermal_zone_device *tz);
> void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
> struct thermal_trip *trip, int temp);
>
>
>
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips()
2024-07-29 16:11 ` [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips() Rafael J. Wysocki
2024-07-30 10:37 ` Niklas Söderlund
@ 2024-08-02 9:55 ` Lukasz Luba
1 sibling, 0 replies; 3+ messages in thread
From: Lukasz Luba @ 2024-08-02 9:55 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM
Cc: Daniel Lezcano, LKML, Niklas Söderlund, linux-renesas-soc
On 7/29/24 17:11, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The only existing caller of thermal_zone_get_num_trips(), which is
> rcar_gen3_thermal_probe(), uses this function to put the number of
> trip points into a kernel log message, but this information is also
> available from the thermal sysfs interface.
>
> For this reason, remove the thermal_zone_get_num_trips() call from
> rcar_gen3_thermal_probe() and drop the former altogether.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>
> A new version, based on the discussion following the v1:
>
> https://lore.kernel.org/linux-pm/20240617183949.GO382677@ragnatech.se/
>
> The Renesas driver change does not depend on the previous patches
> in the series.
>
> ---
> drivers/thermal/renesas/rcar_gen3_thermal.c | 6 +-----
> drivers/thermal/thermal_trip.c | 6 ------
> include/linux/thermal.h | 1 -
> 3 files changed, 1 insertion(+), 12 deletions(-)
>
> Index: linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/renesas/rcar_gen3_thermal.c
> +++ linux-pm/drivers/thermal/renesas/rcar_gen3_thermal.c
> @@ -563,11 +563,7 @@ static int rcar_gen3_thermal_probe(struc
> if (ret)
> goto error_unregister;
>
> - ret = thermal_zone_get_num_trips(tsc->zone);
> - if (ret < 0)
> - goto error_unregister;
> -
> - dev_info(dev, "Sensor %u: Loaded %d trip points\n", i, ret);
> + dev_info(dev, "Sensor %u: Loaded\n", i);
> }
>
> if (!priv->num_tscs) {
> Index: linux-pm/drivers/thermal/thermal_trip.c
> ===================================================================
> --- linux-pm.orig/drivers/thermal/thermal_trip.c
> +++ linux-pm/drivers/thermal/thermal_trip.c
> @@ -55,12 +55,6 @@ int thermal_zone_for_each_trip(struct th
> }
> EXPORT_SYMBOL_GPL(thermal_zone_for_each_trip);
>
> -int thermal_zone_get_num_trips(struct thermal_zone_device *tz)
> -{
> - return tz->num_trips;
> -}
> -EXPORT_SYMBOL_GPL(thermal_zone_get_num_trips);
> -
> /**
> * thermal_zone_set_trips - Computes the next trip points for the driver
> * @tz: a pointer to a thermal zone device structure
> Index: linux-pm/include/linux/thermal.h
> ===================================================================
> --- linux-pm.orig/include/linux/thermal.h
> +++ linux-pm/include/linux/thermal.h
> @@ -210,7 +210,6 @@ int for_each_thermal_trip(struct thermal
> int thermal_zone_for_each_trip(struct thermal_zone_device *tz,
> int (*cb)(struct thermal_trip *, void *),
> void *data);
> -int thermal_zone_get_num_trips(struct thermal_zone_device *tz);
> void thermal_zone_set_trip_temp(struct thermal_zone_device *tz,
> struct thermal_trip *trip, int temp);
>
>
>
>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-02 9:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <2211925.irdbgypaU6@rjwysocki.net>
2024-07-29 16:11 ` [PATCH v2 7/8] thermal: trip: Get rid of thermal_zone_get_num_trips() Rafael J. Wysocki
2024-07-30 10:37 ` Niklas Söderlund
2024-08-02 9:55 ` Lukasz Luba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox