]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
thermal: trip: Get rid of thermal_zone_get_num_trips()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 29 Jul 2024 16:11:29 +0000 (18:11 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 2 Aug 2024 11:59:50 +0000 (13:59 +0200)
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>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/2636988.Lt9SDvczpP@rjwysocki.net
drivers/thermal/renesas/rcar_gen3_thermal.c
drivers/thermal/thermal_trip.c
include/linux/thermal.h

index 5c769871753add43b7c23ee1ee5107e52910edfb..810f866774612b66f025fa8df91d899231203b59 100644 (file)
@@ -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) {
index 06a0554ddc389156ccd51bbbc988bebaa47c0046..e64d045d1603e77ad52dd1e75a6e75146b00ef95 100644 (file)
@@ -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
index 25fbf960b474bd4d1aad8c14a544dc74c8df3b0a..4fdfd5abd2c41f72a7e15c894eb0e19c90159eab 100644 (file)
@@ -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);