[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22339769.EfDdHjke4D@rjwysocki.net>
Date: Tue, 02 Jul 2024 16:44:27 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Lukasz Luba <lukasz.luba@....com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Zhang Rui <rui.zhang@...el.com>, Shawn Guo <shawnguo@...nel.org>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Thara Gopinath <thara.gopinath@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>, linux-wireless@...r.kernel.org,
linux-tegra@...r.kernel.org
Subject:
[RESEND][PATCH v1 5/5] thermal: trip: Fold __thermal_zone_get_trip() into its
caller
From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Because __thermal_zone_get_trip() is only called by thermal_zone_get_trip()
now, fold the former into the latter.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---
drivers/thermal/thermal_trip.c | 18 ++++--------------
include/linux/thermal.h | 2 --
2 files changed, 4 insertions(+), 16 deletions(-)
Index: linux-pm/drivers/thermal/thermal_trip.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_trip.c
+++ linux-pm/drivers/thermal/thermal_trip.c
@@ -114,27 +114,17 @@ void thermal_zone_set_trips(struct therm
dev_err(&tz->device, "Failed to set trips: %d\n", ret);
}
-int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
- struct thermal_trip *trip)
-{
- if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
- return -EINVAL;
-
- *trip = tz->trips[trip_id].trip;
- return 0;
-}
-EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
-
int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
struct thermal_trip *trip)
{
- int ret;
+ if (!tz || !trip || trip_id < 0 || trip_id >= tz->num_trips)
+ return -EINVAL;
mutex_lock(&tz->lock);
- ret = __thermal_zone_get_trip(tz, trip_id, trip);
+ *trip = tz->trips[trip_id].trip;
mutex_unlock(&tz->lock);
- return ret;
+ return 0;
}
EXPORT_SYMBOL_GPL(thermal_zone_get_trip);
Index: linux-pm/include/linux/thermal.h
===================================================================
--- linux-pm.orig/include/linux/thermal.h
+++ linux-pm/include/linux/thermal.h
@@ -202,8 +202,6 @@ static inline void devm_thermal_of_zone_
}
#endif
-int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
- struct thermal_trip *trip);
int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
struct thermal_trip *trip);
int for_each_thermal_trip(struct thermal_zone_device *tz,
Powered by blists - more mailing lists