Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1164306rwb; Wed, 28 Sep 2022 14:15:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AMOG2gXoCidUvSP6qWmkOZtN7LLkZVBi6YFJ6+DG/l98IhkummuG8nIIferkgD6cTeO5f X-Received: by 2002:a05:6402:22db:b0:457:c564:1fcc with SMTP id dm27-20020a05640222db00b00457c5641fccmr9461550edb.68.1664399733223; Wed, 28 Sep 2022 14:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664399733; cv=none; d=google.com; s=arc-20160816; b=rH5BhebLxocdetXeohRYfpnAzEznxfMgE35aCw3KyANbgGCsgD3C/SAbt8gCnPXDdi HraWDx8YGxyeraWIcjQ4G+6HsNs6f+r2idwiGRZMrKFrJtHZD09HRikKBs6TtrXPCxaO Qng9mtkFiJgmgmLx9WPpcXhNypeJhkJ5jJk98ZUwUnbIUtA4xU1B/hBWAfyv1uX4sB5+ CBT2rR8bQD7ikqnZ+NaRtIRKilB++6/BLXhod/grzUg515vgYHeQBuUHCNe8+/Y6bkqV /WWOXMTYqCjEQY0l/u+L3DN1Ea01BMt2eN0H/e6P+LT7NnEzPO636g59N3QBfjIaB08o 8Dzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=FffqpCxVnUDeroCV2SFPN0T0JJsYv8SaP7LzD+s3eomozfwV/gZFQZggmFsEaNyasB cdrZP4m6W5pRnJoaqHmG7onnrtGF3/ksXL9ffQLE18nrYxRNi6iVDNpfGZEJT7k/yNLF wfxM/S2q0tlNdjFgdodkI4JVaKXV+bkDeWnGmP+BvHKFsoNaeADc6WGTnmAkoxXfA3pG 7s0H9FHDavnSXxkvlFfcMs6f8pcMp1Uo5VRFZuNz84K+xX+X1tWzfWuzGwZL5lFhow91 6war4lJM/K1DuLoKSzDe13tTzTav+Rh5PqZHmSjWEhuESxH6IQMGuvlsL62LU/4n/25o kSRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iO99VIKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga34-20020a1709070c2200b0078346f6a75fsi5702036ejc.709.2022.09.28.14.15.01; Wed, 28 Sep 2022 14:15:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iO99VIKH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234474AbiI1VDX (ORCPT + 99 others); Wed, 28 Sep 2022 17:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234157AbiI1VCU (ORCPT ); Wed, 28 Sep 2022 17:02:20 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E9147C1F8 for ; Wed, 28 Sep 2022 14:01:37 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id n35-20020a05600c502300b003b4924c6868so2812444wmr.1 for ; Wed, 28 Sep 2022 14:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=iO99VIKHWYZYBlxXZM1jzIJMfEfORGWVLH/D9fAJIa9XTCA2APEE3foUE6yxpgPUMt hUpD1xxGo8T/jRXApM5vX//kT08IM4VQK0Rj+4SUUXjOt6E7OCtTg2EvzT+OloATSxrb AMVtbswzimKkVX38J7zrh1gu+g4IPXwNyZwjVeZjMzoUMGKEo2MicrPwzZ+Wuj+13MU1 MZ2tZ8Pd5m09Be6fJvU6Cg7qUUv8mMOrAQpvpOfUX8gJP6r+qwIUXNn19ciYVTOsC2G2 0Snr/2jw0AThqvViyVXk3bdqMfCbxTPl6YWnsaBFJF75BDjDsPK9Z4eb0WqCbAcLPkey eHUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=YzUTWEHUQYeukAyJEfTuM3PzyJlxwwnF0DoykmVbPWw=; b=kEZyx9BgelfMK5hJxB8755fwMBv6ml3Eksy9xyxTXbo5HbkgDD4f7+kJR8f/r4maDi DfSS8klyRlUksBN3zZfi1IjRfsWKmHcXzS1bjKOY50DMqlZW/IryqxfYf/sImce9qA5k inQnN3f+1uUHU/gustzSdPA0ZU1xaJ4A0B9vyd4JTWjFcV9LKe8Uvotz28icHdHHKi+E 3rztNR890GCzJUP6akf2x6cvoJZET7Ex5QS9dq881IoTAXj3lnvl4ehPVeWY6VXMhym6 LPsGgUSK5Q8+PfaO7mOODsXpXRxkW0PGIP9Nay5Z2TMKZl9606ZepPJZLBIx6pt8aKrs r+/Q== X-Gm-Message-State: ACrzQf1AwqoekgmTgKR69pMoSzOibt5KC/QV+u+MwS+Aa0fh2sWlEzvU aIMH/Z/qc/WWPuoBgeC4dvLSYg== X-Received: by 2002:a05:600c:5486:b0:3b4:7e47:e19 with SMTP id iv6-20020a05600c548600b003b47e470e19mr3880wmb.12.1664398896261; Wed, 28 Sep 2022 14:01:36 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:48a2:39eb:9d1b:8b8d]) by smtp.gmail.com with ESMTPSA id g20-20020a05600c4ed400b003b4931eb435sm2874300wmq.26.2022.09.28.14.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 14:01:35 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Raju Rangoju , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Peter Kaestle , Hans de Goede , Mark Gross , Miquel Raynal , Amit Kucheria , Nicolas Saenz Julienne , Broadcom Kernel Team , Florian Fainelli , Ray Jui , Scott Branden , Support Opensource , Lukasz Luba , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Thara Gopinath , Andy Gross , Bjorn Andersson , =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , Eduardo Valentin , Keerthy , Kunihiko Hayashi , Masami Hiramatsu , Antoine Tenart , Srinivas Pandruvada , Dmitry Osipenko , netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH v7 08/29] thermal/drivers/exynos: of_thermal_get_ntrips() Date: Wed, 28 Sep 2022 23:00:38 +0200 Message-Id: <20220928210059.891387-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220928210059.891387-1-daniel.lezcano@linaro.org> References: <20220928210059.891387-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 0e33d32a9d2e..91e6860b5ec4 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); -- 2.34.1