Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1184262rwb; Wed, 28 Sep 2022 14:35:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xHtLIY1KM2Z1BfuGYus12Ch/6f212n41QxJbUinkaLnaDhgpCCoAzTvdPlKZ8MKWD7DBq X-Received: by 2002:a63:5845:0:b0:440:2960:323 with SMTP id i5-20020a635845000000b0044029600323mr6195260pgm.11.1664400949070; Wed, 28 Sep 2022 14:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664400949; cv=none; d=google.com; s=arc-20160816; b=TmjTgwjdcxh853KDQGp+f2F/81btMk7WjWKYUU5quSIEnDcNOdUoOXOJKWXW2RwMha 0fdpCUixhVnI+SgdhQiNn4mCWxi8aM0430DZ2IObS9U1W9A1/iEhCmvKZo+8268YGwfE X3XOv6el9BVrf0v7JAcDMV8KigpDUFcjrlk0m/2LVwiHQF+2s6XqnIv1BWaf7zNFB+m/ K86mZ7yvCkdW+N52YO1hHJRjbRaDMeIZ5IU/LKbUtaxXC7uZCnx9ZdnpTZdNznl+rz9O imnrq0JWVVreX/umnn4TgmwhxORasCv53XgoS7TOmP1ZpA9xNRbAyh3vTEIp91AyZT6B ENog== 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=F16FcP49uIGOwU3Sf8ns9eXu8wz72Lx9ob6lOEA95bs=; b=OTfKZAeGoJpO9ThZcnF+kzMLinw0VZWPwxeni8jE9bbzJTw5J+tJepY9dxetvdEQjZ RoVvcxWAeXkjI8zFpq+olOCmF8bMQ5cEuz5r3h3Q83OtFu/OsZVW2jb8rntxZaSsgaAE J8NSEOlqKh8k0D6Ganl/gWLMdoK0fZAH8kEq2R1xFUMw3dEMZz+7T+jOfz4VwkhEklpE LrEJShELDweUhcOyqa6w4XPeZFTMJJscPmlbch71nE4RsiM2zfqT0y2FQiLou67PbafL tpRKgmnJ+8Uxc/kpD280tTWpHZZOvJCjsQDCiNxBriA10j84XHadZWdFWqcf408wsv59 JeVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QZVTEavl; 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 j71-20020a638b4a000000b0043517bc149csi6585870pge.303.2022.09.28.14.35.37; Wed, 28 Sep 2022 14:35:49 -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=QZVTEavl; 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 S234435AbiI1VE0 (ORCPT + 99 others); Wed, 28 Sep 2022 17:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234422AbiI1VDQ (ORCPT ); Wed, 28 Sep 2022 17:03:16 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9BC0D69E6 for ; Wed, 28 Sep 2022 14:01:51 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id i203-20020a1c3bd4000000b003b3df9a5ecbso2063006wma.1 for ; Wed, 28 Sep 2022 14:01:51 -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=F16FcP49uIGOwU3Sf8ns9eXu8wz72Lx9ob6lOEA95bs=; b=QZVTEavlb0VBg8L+KAfL+BOqtjYbh1+jB9Y5bUh35EsJFclMDgQB/cnzLIkhjKULq6 iMvXMTQZj/AJiXJc9g8rM87WL8pA7/y2kjI9UsMIqx+oS9Mwna/zWjCQGQK70zvKRwz8 Rh2PHR/1eLPmSGiCdH7pvUzFB9kzs7AWnI20etsSr4gDPY2rNFuN6IgRnQghaVI914v9 2Ev8DpH5JY3GC9Zw2AVeyh9gfiQW4TfCyrdYELjAJy2A9KB0/Ty6Y08EOGqRtEReR+vA TCVpksKLmd7bRuBfrLQI0ehzJq7D5xDcEQBwFfvhSj9PN7Jx2bsU2RE+g6N6elKDRSX+ 3Mrw== 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=F16FcP49uIGOwU3Sf8ns9eXu8wz72Lx9ob6lOEA95bs=; b=ImIpRqAqRTo10M80JZXPDfz3EUOyuLBU2E1hQXOQYQoXep/DFLMFL4o4KDEMajdGXv ZH1H9fRAa1CKmXwqHw7cS31Mr0PAz7/Q2zdi8nwTveyxKz/bKjFzfZp71J4w3pEVzOLU kbnx4pJXF+gUfvdK4areDkOgfqAJyJlAWW6bHHnXNm9Gr0YV8rVeKH4xpruuRrlQUM9K 6+VbvnE4BJkuqpX9BhxUpsd+xPJn6bN0ShHNBrYDmkFfUk+Pqjb++EPmY9PK1N52TLSs NxCgQ9+RF1BwhfAM3OTp6t0hCYEhYBtg3KcfwGFUR5toQokV2iAqUsnqB1/3AtKEhWQd an/w== X-Gm-Message-State: ACrzQf1xzD0O79OkydNj6uD1kgYaZgYEZY9OejhPeyUBXvR1Zzechbza TYwosJCiSZ8nckVez9gW52jeUQ== X-Received: by 2002:a05:600c:4f56:b0:3b4:b6b0:42d4 with SMTP id m22-20020a05600c4f5600b003b4b6b042d4mr8234359wmq.143.1664398909983; Wed, 28 Sep 2022 14:01:49 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 14:01:49 -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 12/29] thermal/drivers/hisi: Use generic thermal_zone_get_trip() function Date: Wed, 28 Sep 2022 23:00:42 +0200 Message-Id: <20220928210059.891387-13-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 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 --- 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 d6974db7aaf7..45226cab466e 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; } } -- 2.34.1