From: Rafael J. Wysocki Date: Mon, 29 Jul 2024 16:11:29 +0000 (+0200) Subject: thermal: trip: Get rid of thermal_zone_get_num_trips() X-Git-Tag: v6.12-rc1~216^2~2^2~20^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79f194dd54cef3a0212914cd79dda1f91b7bf7f6;p=thirdparty%2Fkernel%2Flinux.git thermal: trip: Get rid of thermal_zone_get_num_trips() 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 Reviewed-by: Niklas Söderlund Reviewed-by: Lukasz Luba Link: https://patch.msgid.link/2636988.Lt9SDvczpP@rjwysocki.net --- diff --git a/drivers/thermal/renesas/rcar_gen3_thermal.c b/drivers/thermal/renesas/rcar_gen3_thermal.c index 5c769871753ad..810f866774612 100644 --- a/drivers/thermal/renesas/rcar_gen3_thermal.c +++ b/drivers/thermal/renesas/rcar_gen3_thermal.c @@ -563,11 +563,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) 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) { diff --git a/drivers/thermal/thermal_trip.c b/drivers/thermal/thermal_trip.c index 06a0554ddc389..e64d045d1603e 100644 --- a/drivers/thermal/thermal_trip.c +++ b/drivers/thermal/thermal_trip.c @@ -55,12 +55,6 @@ int thermal_zone_for_each_trip(struct thermal_zone_device *tz, } 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 diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 25fbf960b474b..4fdfd5abd2c41 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -210,7 +210,6 @@ int for_each_thermal_trip(struct thermal_zone_device *tz, 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);