Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2559603rwb; Mon, 3 Oct 2022 02:33:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hSTxoCLNdo2bOnUPr0sLSKR7FNmFZPd0fZPEqgZpv+9fE3YK5Ss88sfiq/jb/ayMIM2l3 X-Received: by 2002:a05:6402:1bd0:b0:458:f170:fa74 with SMTP id ch16-20020a0564021bd000b00458f170fa74mr4609376edb.382.1664789615948; Mon, 03 Oct 2022 02:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664789615; cv=none; d=google.com; s=arc-20160816; b=lnkOXoVQRAurnsjMAunw8vgCJXxM6owsjWPnBVG7ahlMcPBSIHTEsgMVdGU8sBexFF X4EbV9s8XH7w+pyGzsB5xiKWQ+tc4qwMDvlpdU67e8hZ5n6OJbcjlYn9yS/DfXifltKp gJ5/eHK+QKXrMoSe17VXJGucfadVz+OyXq6VP/ftBN+d2GrcDWjN+GHKfI7ColVIKReM ks8QUMAa+eZvhCy8XHV0Swu8OAzOr3EgpMYq9OH3UCy2tSy22WIntGeRVk+PuToNwNRK Na4bU9jLiHLcqqCa8jF7sGu38dzgyLj1SNX6DGYz2MoPDzqBwaDoZb5+NW8AEESw1X2N QwCQ== 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=RA+3mRTB/OaA2HL5IPu6aKmDXYnatKLx7AIcGwDeYkpbXx6T9BgbFwXQ9jmdFF7kHw UMRwKNvx3VacjKG750ZCTvH4AI2ErtyUOb2dz72gAKC1QcCGK6Lk0cCj+ifakHieXDw9 xLpds3+389hmIYwCxSUgzMvFmTv4ZTdEmxIjDYzydqxDwMCgJSvAxUu+hBp1+1IJAPAf RdZFagKSDfdIxKMLIbPsRHvrW21AZ/AliOptlihxgc5vRMtghbyaIwmiphCbCSK+cUNK gk7gi7FY5M2rDsJ11IWF37jsCF3LUyIjxqUi92yIMdqTDU7HXGdhMZntYuYhsN6zO8UX eSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mFSgZTai; 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 o7-20020a17090608c700b0073de493b83esi7821975eje.147.2022.10.03.02.33.09; Mon, 03 Oct 2022 02:33:35 -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=mFSgZTai; 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 S231405AbiJCJ3V (ORCPT + 99 others); Mon, 3 Oct 2022 05:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231358AbiJCJ2D (ORCPT ); Mon, 3 Oct 2022 05:28:03 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BDBC33E0D for ; Mon, 3 Oct 2022 02:27:03 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id u10so15656098wrq.2 for ; Mon, 03 Oct 2022 02:27:03 -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=mFSgZTaipm7xmr3EZbI2P6hL0ODEi0vI0xyRaY7cB2lrRd25caRnXRiETYkIwyUlhA tzNRCBenT9eVVAaNY+k1ZQoyhFKKYiANfmYgpl+eJqoAbwu+gqNQ81lNvEOmSDnoISg3 6QHsvqLHULU4cB5seIQZa0iMVKxLt7YzULq4oq+TzolVy1hiThmLmL1sKDE0tmn1GiV8 kYcxBewGbGKYMC5/6v51E/zXc2L4MXcaZFq6bvcJGMowjQVc28Cg0u7bs5jODtykh7Xc hk1Lr7MSY/er1RxcnJIVZfYfktCqmvFK1WuDnMeeNlj4eibLJWrePDEycuq9WyPQm+d9 mELw== 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=aY2TwcXFNkp/2Dv0e+23O/JPAdUxLL+7A1qbSmAlT+gqLYuFyLPmHLH4RW/CFH+atN /WuEAXubgSANRgsQPG2qKQFGVJoUgXzIUgpoKqundpka8vW/9C4IxytiarHphIWjzrxN ILy6eTI8aH0Hf8vDB2Kn8CVx34hKh01PvBNGfb0dS9jaS7utGOr+fDr3isOd1SdX/B2y v7tPM5vfC4eVUgDjOhkie8LEClMffnMa8nXqBq/+625x3hCbf//N2k4+kcYEkGVaLpo/ n1poAV5VJiIyCRRPFsrQUqGdU5TT5jHUsQOzquenumzMg7kbaN9iW4wBC2TWawQq3fTE BvOQ== X-Gm-Message-State: ACrzQf0irEHD2HRHe+Vyd755vLT9PruzXP2kCtXaa+ab7PkFHCQkkw0q VpHKcLqzKai10wgxLEgbhG9lCg== X-Received: by 2002:a05:6000:1c5:b0:22e:3c0b:5c8 with SMTP id t5-20020a05600001c500b0022e3c0b05c8mr2819474wrx.622.1664789200187; Mon, 03 Oct 2022 02:26:40 -0700 (PDT) Received: from mai.. ([2a05:6e02:1041:c10:f3a:9f5e:1605:a75a]) by smtp.gmail.com with ESMTPSA id ay3-20020a5d6f03000000b0022cc157bf26sm9707520wrb.85.2022.10.03.02.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Oct 2022 02:26:39 -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 v8 08/29] thermal/drivers/exynos: of_thermal_get_ntrips() Date: Mon, 3 Oct 2022 11:25:41 +0200 Message-Id: <20221003092602.1323944-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221003092602.1323944-1-daniel.lezcano@linaro.org> References: <20221003092602.1323944-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