From patchwork Fri Dec 9 15:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thermal-bot for Lad Prabhakar X-Patchwork-Id: 632778 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 A4DB9C4708D for ; Fri, 9 Dec 2022 15:27:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230400AbiLIP1V (ORCPT ); Fri, 9 Dec 2022 10:27:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbiLIP0o (ORCPT ); Fri, 9 Dec 2022 10:26:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47A3492301 for ; Fri, 9 Dec 2022 07:26:38 -0800 (PST) Date: Fri, 09 Dec 2022 15:26:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1670599595; 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=ASxGgiXZQ4Ay4YApp7PDfb1v1ALi1q6NvDmYIqVXMew=; b=DQZVq+TydL6NK6WwBLo5aBX+0fsyTNwZj+z+UfK6ewr+ESrClrhGoJPuN9keBnb8b3Q1Wd ulpbm7NBJX+PXYJhNpDqhNectEqYWDhf2dzOkYPZTnsJw9IjP81AQb57oQtJR1n+sKMfkd NP1/i5QY0+hftUhb7VThJxFqp0jg7/DCZwGy4x+/Asw8auexAv+yols1yT3ne/5BiXVtxY 367MPqvGnK0g7kC0FwMQOIIIUaiL/lFLBHd6Hs8D8YnhN7q1yPIPL6hwwPxDGc3zJMdl0X 8S7bFIeMckSwQn8W8EwDY4dB+s1I5W2qukEpmLGpvZlCNoHp15iBAKZj85+Cpg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1670599595; 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=ASxGgiXZQ4Ay4YApp7PDfb1v1ALi1q6NvDmYIqVXMew=; b=cVqeCrP/zU6s5Vv9H9BTlJj5U2iBU3/724SU5DbiemqJAHwoK7H9jZLDdmhk9tqA9Bpoei piiwCzul9/+1VCCQ== 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/drivers/hisi: Use generic thermal_zone_get_trip() function Cc: Daniel Lezcano , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20221003092602.1323944-13-daniel.lezcano@linaro.org> References: <20221003092602.1323944-13-daniel.lezcano@linaro.org> MIME-Version: 1.0 Message-ID: <167059959473.4906.10673450868128802485.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: 14d5b7d3d338cc90f5d40c6059cc5080f392dd51 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//14d5b7d3d338cc90f5d40c6059cc5080f392dd51 Author: Daniel Lezcano AuthorDate: Mon, 03 Oct 2022 11:25:45 +02:00 Committer: Daniel Lezcano CommitterDate: Thu, 08 Dec 2022 14:30:42 +01:00 thermal/drivers/hisi: 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. Convert ops content logic into generic trip points and register them with the thermal zone. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20221003092602.1323944-13-daniel.lezcano@linaro.org --- drivers/thermal/hisi_thermal.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index d6974db..45226ca 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -482,7 +482,7 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, struct hisi_thermal_sensor *sensor) { int ret, i; - const struct thermal_trip *trip; + struct thermal_trip trip; sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, sensor->id, sensor, @@ -495,11 +495,12 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, return ret; } - trip = of_thermal_get_trip_points(sensor->tzd); + for (i = 0; i < thermal_zone_get_num_trips(sensor->tzd); i++) { - for (i = 0; i < of_thermal_get_ntrips(sensor->tzd); i++) { - if (trip[i].type == THERMAL_TRIP_PASSIVE) { - sensor->thres_temp = trip[i].temperature; + thermal_zone_get_trip(sensor->tzd, i, &trip); + + if (trip.type == THERMAL_TRIP_PASSIVE) { + sensor->thres_temp = trip.temperature; break; } }