Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1026519rwb; Thu, 4 Aug 2022 15:55:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qwq63yE5wULX5Z1YNmFTyrcAaPbFOZs4MCBLc3pZXxVfCf5daEXiO8o6iERv7ljKQuKxj X-Received: by 2002:a17:907:9710:b0:730:a937:fb02 with SMTP id jg16-20020a170907971000b00730a937fb02mr2899945ejc.577.1659653739828; Thu, 04 Aug 2022 15:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659653739; cv=none; d=google.com; s=arc-20160816; b=THqEwiM1LyqoQCUg8rSy9csNICwFNDd8UH5hvQCEbVwp+wfUEfOwImVCBD+nDJ5VoQ RX+f7u/PFhFhR/vR7D2I30WGG7Tc1uvOwhzecczWjQHTdrYatKb2Q1NoQR7JWu25LfrQ YRupiGPQls0buUgiZySbJX4KAX0AMFhA2WGveQquQ3VncOre64WrGP1SOiP9T99QOO3t m3IlwEpofIS9ufSVxBl7T3QcmDot39ye4yjxezHZ6hvBRiOhj5SYkScdnPrNvJFBmuEn X7KdhLkT0s6N0S3DbWr95/WAnFuAMKfTYHerNYx2TGIehQIquxD5HWNhNuXobZVPvHwk ykZw== 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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=fb6rC2QIFNUU3ZMJgFI9u4TCjxTYsAqXKvdApeq24zkyMtGOTwb0RRBR2v0EU4J4MB ks/c6x44x8q5E1Qc+Cgv7NSf3XAJbL4md9DfIp2MHd9tu9PEwdhh1bMtylSka4MsJ4J2 eZmpZhFxDWfc1UeFQ++W7yfIClBahUJ7XGCHUv66AulLJlUMakFmkgUiEJWq0RRS6uFt CWQ0d4IWvEHQ5tFokx9U1ZwsYYqG6Ks+ZFy/Xt0t4W9KUTZL49XD9uezw1lt839DvWhU 6redwM9ZAteA4eeN+5ExSU/73tshQ2wfZZfeDYPfz+wbvJesjRcRlFbBjRZQ11zZYNTB mpVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=Hapj0n4c; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs24-20020a170906f19800b0070f89ef5eb5si1776429ejb.283.2022.08.04.15.55.14; Thu, 04 Aug 2022 15:55:39 -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=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=Hapj0n4c; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239634AbiHDWxh (ORCPT + 99 others); Thu, 4 Aug 2022 18:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235490AbiHDWxC (ORCPT ); Thu, 4 Aug 2022 18:53:02 -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 CEE3473910 for ; Thu, 4 Aug 2022 15:52:32 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id h13so1355788wrf.6 for ; Thu, 04 Aug 2022 15:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=Hapj0n4cQ17IpR6CaDW8h880hkcV9+OjY0LG1WLlOnTq9iPkGKning/o3qI8Lk7UyC GuVOYAcnUSAc3X5VY9fkZb2Xo78TbnWnZ7MggW/1QwVqV69WryDDC/uzEqU0M+HBY5eL o6j3m6UKDfZH3qjYVOya76HsKWNBVhnzOY9BOlMemIio0+hw9CVQAFEXxHdH37cu0Mvh omO3oDYiU1sVcZqV713g+4RK3asDdc00GK0FbnuQpzZZOMafRqvP5vmq00U1ZkuIEDxm EYIQbbe/kIrh9/tluD0++4AC4MtFuTCJLJB1In/KsYZel4Mzk2Mrvm3HyY+d6Hr4DFva X0Aw== 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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=OL8w/BemOkVCUMrQ5gZ8fMVCvg0s8vvlXK9N0/y9Gx9HA/+RI/lvcbnufRxICc9wuE V7CLA6oGwiidVHgwKfBzbZ3fPmSjXmj3p2oQ3JMRYpFRuJIL0FQFaUBKoyB7Op7xjp5V T7Srg4LXO4QOwAlDqq/tNfDxRv44C7prVYFLvNN72oNFusiPM3fGbdfUka47bhCbT1aO 4R0h09o+9MFBVqslzOWsXeFRiBxDHQYILGbhzNnDeBlXCAPsjrjW/hMbF5tP+mSAt1Z7 L/7LUgDW/znOG4hc8Qih3zUIylcvzjGR7wtibthds/LJTXvsaltOijOM8fP+lxDEWa4L 6YyQ== X-Gm-Message-State: ACgBeo1skGGeE0qAWD0SkR8Pi8Kr2X+jYMxqdniabcRcXo0wXWxAcVh6 sq3NeqFixGOZ23TCEMkIR1kp9g== X-Received: by 2002:a5d:47a1:0:b0:21d:a4c6:352b with SMTP id 1-20020a5d47a1000000b0021da4c6352bmr2529176wrb.365.1659653551042; Thu, 04 Aug 2022 15:52:31 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:31aa:ed2c:3f7:19d]) by smtp.gmail.com with ESMTPSA id a16-20020a056000051000b0021f87e8945asm2495906wrf.12.2022.08.04.15.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:52:30 -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, khilman@baylibre.com, abailon@baylibre.com, lukasz.luba@arm.com, broonie@kernel.org, damien.lemoal@opensource.wdc.com, heiko@sntech.de, hayashi.kunihiko@socionext.com, mhiramat@kernel.org, talel@amazon.com, thierry.reding@gmail.com, digetx@gmail.com, jonathanh@nvidia.com, anarsoul@gmail.com, tiny.windzz@gmail.com, baolin.wang7@gmail.com, f.fainelli@gmail.com, bjorn.andersson@linaro.org, mcoquelin.stm32@gmail.com, glaroque@baylibre.com, miquel.raynal@bootlin.com, shawnguo@kernel.org, niklas.soderlund@ragnatech.se, matthias.bgg@gmail.com, j-keerthy@ti.com, Amit Kucheria Subject: [PATCH v5 14/33] thermal/drivers/armada: Switch to new of API Date: Fri, 5 Aug 2022 00:43:30 +0200 Message-Id: <20220804224349.1926752-15-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804224349.1926752-1-daniel.lezcano@linexp.org> References: <20220804224349.1926752-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano --- drivers/thermal/armada_thermal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index c2ebfb5be4b3..52d63b3997fe 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -420,9 +420,9 @@ static struct thermal_zone_device_ops legacy_ops = { .get_temp = armada_get_temp_legacy, }; -static int armada_get_temp(void *_sensor, int *temp) +static int armada_get_temp(struct thermal_zone_device *tz, int *temp) { - struct armada_thermal_sensor *sensor = _sensor; + struct armada_thermal_sensor *sensor = tz->devdata; struct armada_thermal_priv *priv = sensor->priv; int ret; @@ -450,7 +450,7 @@ static int armada_get_temp(void *_sensor, int *temp) return ret; } -static const struct thermal_zone_of_device_ops of_ops = { +static const struct thermal_zone_device_ops of_ops = { .get_temp = armada_get_temp, }; @@ -928,9 +928,9 @@ static int armada_thermal_probe(struct platform_device *pdev) /* Register the sensor */ sensor->priv = priv; sensor->id = sensor_id; - tz = devm_thermal_zone_of_sensor_register(&pdev->dev, - sensor->id, sensor, - &of_ops); + tz = devm_thermal_of_zone_register(&pdev->dev, + sensor->id, sensor, + &of_ops); if (IS_ERR(tz)) { dev_info(&pdev->dev, "Thermal sensor %d unavailable\n", sensor_id); -- 2.25.1