From nobody Sat Apr 11 22:47:44 2026 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 32432C00140 for ; Fri, 5 Aug 2022 14:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241143AbiHEO6m (ORCPT ); Fri, 5 Aug 2022 10:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241032AbiHEO6J (ORCPT ); Fri, 5 Aug 2022 10:58:09 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34A7166113 for ; Fri, 5 Aug 2022 07:58:00 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id bv3so3543012wrb.5 for ; Fri, 05 Aug 2022 07:58:00 -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; bh=Yosq6bk1KHjuPLLTagCwdDixZvCyUy9tf9EC98uzdoY=; b=g61M2nI4MW3BY2KzXjQ9Xu4ZtS1xfntiPVj2Za79gcRp5mTi6A3l+/fM0uJMIYsbEb vEyfL4p9pWhbBQJ1JS7H+GXqTzKYisoJrQhbQh2lqjHiA65KEK197gi5XuNHLcCEdQii FFu5KFhGE8xjXbIyovQe53i9QhQIa7zE8YePYA4ktl/+fRu9Q/sMM1M7H4X9EwTbHrah k5TQEF5OZhfq1ULGMgIwRh71yPl7vnAtEWCSdh2vLCZVkgxkCPCzJWvMWav2gjIpJA1e q9FNWDzrcky/aOLymL+0zSK529KyZK+TIR2mCLsPOjI6uGyo+BH7wDYr+crRr2zgwXDU yNrw== 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; bh=Yosq6bk1KHjuPLLTagCwdDixZvCyUy9tf9EC98uzdoY=; b=CZBLWfSrCVB0v+ExQ6Pj0YcNbMa1pw7IMvhdLFxjgvTPixhSRnrsRGG8ufeYm1LBWs Mcjy9LdvCf/KCsB2JTrKVBhEF5EleyTqlulVID9QEvzXRO1A34zWsAJCreQ777zqZv79 dqz+NH7RU6QG5p+aRBW/WxYdSd2IS66vP4wETQP3AGwS5IjsY/gG2dC2opUFz7OMjrhn aB0BsBMRL4hFGveS2jjIx+6bbOTsZ9L2WXmkwQMOCUknIbnh4WpsR4H+IIhKZdSJPMTy QK+CDK3UgN1W8hxfGl2OQxZ5Iy0eIlAQyripjwNJimdW6rKVMGwOTnIE6SyozCCyIMgd z19Q== X-Gm-Message-State: ACgBeo1N/wT3rCzgCu7mQsbu0tOWqVBVDTkM268NTx3bznRvSCA4tu4X ifBnkaOn6F9hljyxMxDQd0r/LA== X-Google-Smtp-Source: AA6agR4Hmvll0cmg0okuHWG6GU4XzaIAGCE+u1/i4v9wDFqF69T06Pt3Lq3LX/Ds0zZvGque53q7rA== X-Received: by 2002:a5d:595f:0:b0:220:619d:da07 with SMTP id e31-20020a5d595f000000b00220619dda07mr4566872wri.10.1659711479282; Fri, 05 Aug 2022 07:57:59 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:aef0:8606:da6b:79ef]) by smtp.gmail.com with ESMTPSA id y1-20020adfd081000000b0022159d92004sm3102448wrh.82.2022.08.05.07.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 07:57:58 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Amit Kucheria Subject: [PATCH v1 10/26] thermal/drivers/hisi: Use generic thermal_zone_get_trip() function Date: Fri, 5 Aug 2022 16:57:13 +0200 Message-Id: <20220805145729.2491611-11-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220805145729.2491611-1-daniel.lezcano@linaro.org> References: <20220805145729.2491611-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 t= he 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 cc5da71b6f55..914dc73f4263 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -490,7 +490,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; =20 sensor->tzd =3D devm_thermal_of_zone_register(&pdev->dev, sensor->id, sensor, @@ -503,11 +503,12 @@ static int hisi_thermal_register_sensor(struct platfo= rm_device *pdev, return ret; } =20 - trip =3D of_thermal_get_trip_points(sensor->tzd); + for (i =3D 0; i < thermal_zone_get_num_trips(sensor->tzd); i++) { =20 - for (i =3D 0; i < of_thermal_get_ntrips(sensor->tzd); i++) { - if (trip[i].type =3D=3D THERMAL_TRIP_PASSIVE) { - sensor->thres_temp =3D trip[i].temperature; + thermal_zone_get_trip(sensor->tzd, i, &trip); + + if (trip.type =3D=3D THERMAL_TRIP_PASSIVE) { + sensor->thres_temp =3D trip.temperature; break; } } --=20 2.25.1