From patchwork Fri Dec 9 15:26:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thermal-bot for Julien Panis X-Patchwork-Id: 632775 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16D4EC25B04 for ; Fri, 9 Dec 2022 15:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbiLIP1a (ORCPT ); Fri, 9 Dec 2022 10:27:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230461AbiLIP0p (ORCPT ); Fri, 9 Dec 2022 10:26:45 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D5592313 for ; Fri, 9 Dec 2022 07:26:38 -0800 (PST) Date: Fri, 09 Dec 2022 15:26:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670599596; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=32J/iX74GSP8y5p6CuEUSiSXjgb/updKo5PSQ3ngUSY=; b=gXJE8l9V/kovf5c7L+hLuk0h3bM4rwuMMWATRIbqxXJud7HCGUqubr2WsQ0NcJjzmht07t 8mbPLTikHqPDB4RqVXT1WVGK6uzLsAlil3WFI/z2KtzWpw2kEi5iFG/yxpSfSYND9qXCbK u0alLawYCWVmjGaVfzxD1rjnwLXHRDmz2XGXI29OpxSKPEyGBV+SE3qBMjnF6EYJ6cEulN yf5GkH9AXCQ/pmiTWgxG5ZnjonW0WZsIeGxHJXwMcd0MuYmxBNtJmG5EtOX16WzvEP6iy+ 7pmfRIyGSnNQWMHtyL7o0mkgghhuzHS7uck349DzHSSOq5uYNc0o6kpW/lqJhQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670599596; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=32J/iX74GSP8y5p6CuEUSiSXjgb/updKo5PSQ3ngUSY=; b=/B7iB5HJz95NAToHmSnN2uvuaX96rki7ED9Zq/K4h3tME4JWLUT3atBQZ8vj6qUBwrf4t3 zzS48bSmf+JTv+AA== From: "thermal-bot for Daniel Lezcano" Sender: tip-bot2@linutronix.de Reply-to: linux-pm@vger.kernel.org To: linux-pm@vger.kernel.org Subject: [thermal: thermal/next] thermal/of: Use generic thermal_zone_get_trip() function Cc: Daniel Lezcano , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20221003092602.1323944-6-daniel.lezcano@linaro.org> References: <20221003092602.1323944-6-daniel.lezcano@linaro.org> MIME-Version: 1.0 Message-ID: <167059959586.4906.12597441467687215346.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The following commit has been merged into the thermal/next branch of thermal: Commit-ID: 2df03b0ea88d284cb43c18da26117a5866951b9f Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//2df03b0ea88d284cb43c18da26117a5866951b9f Author: Daniel Lezcano AuthorDate: Mon, 03 Oct 2022 11:25:38 +02:00 Committer: Daniel Lezcano CommitterDate: Thu, 08 Dec 2022 14:30:42 +01:00 thermal/of: Use generic thermal_zone_get_trip() function The thermal framework gives the possibility to register the trip points with the thermal zone. When that is done, no get_trip_* ops are needed and they can be removed. The thermal OF code uses the thermal_zone_device_register_with_trips() function. It builds the trips array and pass it to the register function. That means the get_trip_* ops are duplicated with what does already the core code. Remove them. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20221003092602.1323944-6-daniel.lezcano@linaro.org --- drivers/thermal/thermal_of.c | 36 +----------------------------------- 1 file changed, 36 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index d4b6335..5cce836 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -71,39 +71,6 @@ of_thermal_get_trip_points(struct thermal_zone_device *tz) } EXPORT_SYMBOL_GPL(of_thermal_get_trip_points); -static int of_thermal_get_trip_type(struct thermal_zone_device *tz, int trip, - enum thermal_trip_type *type) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *type = tz->trips[trip].type; - - return 0; -} - -static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip, - int *temp) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *temp = tz->trips[trip].temperature; - - return 0; -} - -static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip, - int *hyst) -{ - if (trip >= tz->num_trips || trip < 0) - return -EDOM; - - *hyst = tz->trips[trip].hysteresis; - - return 0; -} - static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip, int hyst) { @@ -626,9 +593,6 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor, goto out_kfree_trips; } - of_ops->get_trip_type = of_ops->get_trip_type ? : of_thermal_get_trip_type; - of_ops->get_trip_temp = of_ops->get_trip_temp ? : of_thermal_get_trip_temp; - of_ops->get_trip_hyst = of_ops->get_trip_hyst ? : of_thermal_get_trip_hyst; of_ops->set_trip_hyst = of_ops->set_trip_hyst ? : of_thermal_set_trip_hyst; of_ops->get_crit_temp = of_ops->get_crit_temp ? : of_thermal_get_crit_temp; of_ops->bind = thermal_of_bind;