From patchwork Sat May 7 12:54:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 570683 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 09068C4332F for ; Sat, 7 May 2022 12:55:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1446408AbiEGM7g (ORCPT ); Sat, 7 May 2022 08:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391978AbiEGM7Q (ORCPT ); Sat, 7 May 2022 08:59:16 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BA72B8A for ; Sat, 7 May 2022 05:55:22 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id e24so13429917wrc.9 for ; Sat, 07 May 2022 05:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z/3SG51L76j371xoLprO5E0bcUDIZoNhzkCxIpDaKlc=; b=d1aPND7vtBHTKlopYpAirXVaCBjuyPnzkKChgWratJAiSKtLNw02EMp02G16Jx5rE/ dBJcTfcHnlobFrBABVBNmF+qawvwJBFPPu1RGtGFIUCOX67fOeI1YqeOix/pVFJAoD7A YhFRJAIIIZ999lJ7a1G0NkjY6IHf23gBLR+JVLSj4/HUj/GWKlnJFzqh8yUniY3cOCgS rnH9+1zcLI6n8kMgIqpFssGmjVoKKQp6oc2fvIb4Js6yj91k1rzLt+vJUTL2a3Mx1twf 8otoX6QsSiE+YgWuDRjVXn6wCMd4+X7S+hSwkhYLBIQcJDpKO3Bnkt5Y5+5FS2ec4+sA B6pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z/3SG51L76j371xoLprO5E0bcUDIZoNhzkCxIpDaKlc=; b=eEMIuEtL0cqJy6VuyLW3l8DBT9bBxxnCvLyI0Xk+ER1l/ulQkYg3kz8ntRNiNbSg2A nVA7PLzyVfy+CxowKX6MEG8sToqXnwBTpxr7W4RLBz05Rcp6CYwDbcuAmTbKKSyAFwjs asIDA1X/hkDb+T+xcYqHBVd1D0rQihsIVTO+ScYB8XYFifE7zPBeefj9Qzb4qlA7asHD qTkL6mFqCZhBL0OwCsDX5ZXgTDkWYhvbmnmeg6XWQoKupY10+jIZArED8T37eIZ+KU87 vsM4xeC5vjAnfH4l97/7s2zUND7ZBelJPnsdQ8VCMf5oFgV3eqp8Wt6iAOZSQeZlOoX1 gQZg== X-Gm-Message-State: AOAM533XQPAcn9R6dDGKYaArleDWVGINq9iABT67nkk5m/wlcniHVDZ2 Hqkuw31oAMSIz/gQjhW078xYUA== X-Google-Smtp-Source: ABdhPJwg8CZ2XSeNZvkp6RLmvlUklOcTecMNk4pL2FHy6Iln0Hhp1MeArTV7/q2+oWYYalZl1gx7nQ== X-Received: by 2002:adf:cc82:0:b0:20a:cf3b:4624 with SMTP id p2-20020adfcc82000000b0020acf3b4624mr6532297wrj.573.1651928120674; Sat, 07 May 2022 05:55:20 -0700 (PDT) Received: from localhost.localdomain (static-176-182-171-101.ncc.abo.bbox.fr. [176.182.171.101]) by smtp.gmail.com with ESMTPSA id e9-20020a05600c218900b0039453fe55a7sm10470345wme.35.2022.05.07.05.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 05:55:20 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: khilman@baylibre.com, abailon@baylibre.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH v2 12/14] thermal/of: Store the trips in the thermal zone Date: Sat, 7 May 2022 14:54:40 +0200 Message-Id: <20220507125443.2766939-13-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220507125443.2766939-1-daniel.lezcano@linexp.org> References: <20220507125443.2766939-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org As the thermal zone contains the trip point, we can store them directly in the when registering the thermal zone. That will allow another step forward to remove the duplicate thermal zone structure we find in the thermal_of code. Cc: Alexandre Bailon Cc: Kevin Hilman Cc; Eduardo Valentin Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_of.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index a8a3cb309822..200d1d784211 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -1105,11 +1105,9 @@ int __init of_parse_thermal_zones(void) tzp->slope = tz->slope; tzp->offset = tz->offset; - zone = thermal_zone_device_register(child->name, tz->ntrips, - mask, tz, - ops, tzp, - tz->passive_delay, - tz->polling_delay); + zone = thermal_zone_device_register_with_trips(child->name, tz->trips, tz->ntrips, + mask, tz, ops, tzp, tz->passive_delay, + tz->polling_delay); if (IS_ERR(zone)) { pr_err("Failed to build %pOFn zone %ld\n", child, PTR_ERR(zone));