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: "tip-bot2 for Kirill A. Shutemov" X-Patchwork-Id: 13069806 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 3C0D7C04FDE for ; Fri, 9 Dec 2022 15:27:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiLIP11 (ORCPT ); Fri, 9 Dec 2022 10:27:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbiLIP0p (ORCPT ); Fri, 9 Dec 2022 10:26:45 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D346E92314 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=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=9P5SPJHgNChuumBGZIiVeYRkN3bgsa3CVlpvAdVm7v8=; b=i2M7U1g+L+20MLtamM1nVUyLPKiQ+AOT684scuhwG9bguqf9BX2F905tlzjTbQVCZSWE3T 5p5ooKafEXkUhI56PTANYbrSxyY98Pv1r+kErT0wuR+m0HwyXSv59ye0yyUtm8oelBc67t WlHC+0qRf888ARu0yZ68unmK5N8zO6uZO2T49CrYpGRJaMyqS7dzXpYg+kGlGsaMhpHfSl jvuUToplSOMiPEUfeJjpbaZpDTNhxPUNyEaxm8iliEgfGcqeNSpFzvMlnAFSd5dYdSbB63 rdMhlXN/4Nm5B+QiDmvFM1wgpfwaTqwCbWVoYQmXm2deWawUpx+t8Ug8EIAbKA== 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=9P5SPJHgNChuumBGZIiVeYRkN3bgsa3CVlpvAdVm7v8=; b=ByjiOfactBn4zws2SODn2UESzGdaAJumoqdwZvInjKNJu7DcAstmL5uVl+MqUhH9bChNsq Zf3nx8zqUJLBm6CA== 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/exynos: of_thermal_get_ntrips() Cc: Daniel Lezcano , Krzysztof Kozlowski , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20221003092602.1323944-9-daniel.lezcano@linaro.org> References: <20221003092602.1323944-9-daniel.lezcano@linaro.org> MIME-Version: 1.0 Message-ID: <167059959537.4906.296872850910393930.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: 27998c5baa70da4e5a2ff85505b2e3bd0abf74d6 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//27998c5baa70da4e5a2ff85505b2e3bd0abf74d6 Author: Daniel Lezcano AuthorDate: Mon, 03 Oct 2022 11:25:41 +02:00 Committer: Daniel Lezcano CommitterDate: Thu, 08 Dec 2022 14:30:42 +01:00 thermal/drivers/exynos: of_thermal_get_ntrips() The thermal core framework allows to get the number of thermal trips, use it instead of visiting the thermal core structure internals. Signed-off-by: Daniel Lezcano Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20221003092602.1323944-9-daniel.lezcano@linaro.org --- drivers/thermal/samsung/exynos_tmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 7b609bd..2541387 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -260,6 +260,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); struct thermal_zone_device *tzd = data->tzd; + int num_trips = thermal_zone_get_num_trips(tzd); unsigned int status; int ret = 0, temp; @@ -271,12 +272,12 @@ static int exynos_tmu_initialize(struct platform_device *pdev) goto out; } - if (of_thermal_get_ntrips(tzd) > data->ntrip) { + if (num_trips > data->ntrip) { dev_info(&pdev->dev, "More trip points than supported by this TMU.\n"); dev_info(&pdev->dev, "%d trip points should be configured in polling mode.\n", - (of_thermal_get_ntrips(tzd) - data->ntrip)); + num_trips - data->ntrip); } mutex_lock(&data->lock); @@ -289,7 +290,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) ret = -EBUSY; } else { int i, ntrips = - min_t(int, of_thermal_get_ntrips(tzd), data->ntrip); + min_t(int, num_trips, data->ntrip); data->tmu_initialize(pdev);