From patchwork Mon Jul 25 21:26:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 594001 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 BABC6C43334 for ; Mon, 25 Jul 2022 21:28:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237413AbiGYV2b (ORCPT ); Mon, 25 Jul 2022 17:28:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237366AbiGYV2A (ORCPT ); Mon, 25 Jul 2022 17:28:00 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD0324F35 for ; Mon, 25 Jul 2022 14:27:34 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id u5so17716885wrm.4 for ; Mon, 25 Jul 2022 14:27:34 -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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=TrmbTyY+Jm2q3X/X6q1QtexNHvpBiAtomY5PyCgxik2uwmeaOGsOEuZemKSuqC97io Sk5axPQjpfDHpUFPl4ipa5f4cqQs9MVFPBDsO5t3w3MzZ39hrFXWdlt2VXIrcIASvktu TZISCuAMjEKCDjKiV2pWa1SkEreQbNQOu8mWIpovWrCB8o9zXvfjmfMekKdDhSGmlt/V tviRbaSiOAiiOy7W0YREjxbLjNFVkV4IefXYr6J+6/IAjMGPR6yb3r6ILhaXkCz/L2kp 1Vw76tVpM8nPiiUODJ9GLAFiE2TW1SQrC/T2WtCc9qg66L6byOzbALRM5EWxFyORY0Vp h58Q== 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=3KXZ40ukCVssYokTyD4CFy6bR4TME8bIQCib4ndaUEM=; b=IyvGriqTPv85HDxoplnM8EF3BxU1V+OsRdYZfzL79znIg6B//t10o4t2o2Lo1Qo0mx xJFIwOemyvDsz4ApFpa1lnaq9Zs1+Gl3m1e4K47aJzZg9SSro64ZS6VxNeZjFfpBDWP5 DCpk+G/B9Z277rJbXTBejOV/Vz+WOXdh/FEvuXpeaBYyssJPPMct+5Wp/rFr83dC9/lu KesmlY65nlkDjpcP1URRMfikRvFfXXjYM+8+kqCGElV/CYOXj/tBwnFgW9njp1vN/kpC 8Ze+uaAz8QVxTzhaWj0Di8IWHmZSHvI2Brj5qKoofckZv2PZKxd5GA2DAVwz0WqX7XBD JKxA== X-Gm-Message-State: AJIora/dOF7hPI/d5I0lgxirVvkBOeWETJOBaQqMeIOCIVVRncX1VjaL SEU6IKx8BCuNrwqzJokq1a7mhQ== X-Google-Smtp-Source: AGRyM1umqWm+lULt+EkMxEKGIKTa0FZKFgM3T61QU8a0rBwxpmni/9bWC4Jmj8OwNZ9DmLN1TN8HMA== X-Received: by 2002:adf:fb83:0:b0:21d:649a:72d9 with SMTP id a3-20020adffb83000000b0021d649a72d9mr8412084wrr.688.1658784451499; Mon, 25 Jul 2022 14:27:31 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:1780:8e54:dd38:6668]) by smtp.gmail.com with ESMTPSA id r17-20020a5d52d1000000b0021d68a504cbsm12668772wrv.94.2022.07.25.14.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27:31 -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 v2 14/32] thermal/drivers/armada: Switch to new of API Date: Mon, 25 Jul 2022 23:26:19 +0200 Message-Id: <20220725212637.2818207-15-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220725212637.2818207-1-daniel.lezcano@linexp.org> References: <20220725212637.2818207-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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);