From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D35C0C04A68 for ; Wed, 27 Jul 2022 21:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/y8+gb6qhlyP+tFihK20IFIogp5J1SA0hujCuVLglwM=; b=YlG9H6pPDyfMMo BwnFT/IWBZhRxdZWN1LjMRy1C1X1HqyoD2gCr/tyqPrhX17aimTaOsNzN41yPQd8Blghv4WYvFH8/ LfyzrMO6UeR6L9XOQgEjzJ4U4EROY2fJ6ZI69Jxs1yY/OWdFoQTmGb9Ro+IOt+rJYRege9NzoTncy xx8wp8q6DcG7zHEVhxE7dcUy0KiMbCwN2S6VMOP5o0FBXkN/Cwr9bR8uIdAFppa0hxZvjck4OuoD5 BdNoWY/29ug0hV+9x99UGTJycJoNcSBRhLOLNpsakUvLKOi1tHGzKzNoWMzABIrWEphSC5YHyqhaM +iyki1eAHUp1b349eYwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGoEM-000ItB-8b; Wed, 27 Jul 2022 21:06:11 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oGoC7-000HQs-DV for linux-arm-kernel@lists.infradead.org; Wed, 27 Jul 2022 21:03:53 +0000 Received: by mail-wr1-x429.google.com with SMTP id v13so18300005wru.12 for ; Wed, 27 Jul 2022 14:03:51 -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=lgLe7sgvzaU3jF4XA+SfoE2vippSYThYf8kMVph3yKg=; b=jZFwziLi1QRj+gAtn+EUomuOooQMzKebyFMh8wB57mgJd6MiPgz4XhXFHPpyI2Eqq0 +UukbTfXprAGUcQY0nlij8M76MI0KQLMpec1yCxfu/7J0x3rWa63DzXuwH9Pp9+GFsQi z739WG7sGM/1HT6GSp8328CSMVvGiOq0dHRUrwjC2oSKb1osCAUuyT0pC8vFvfqq/pZA RmMrldALamX4T0srDPdYCLKaStdO1xMm2HuXP7EgDbwn4SHyJnFN+HnJ4UeIKaGMMkHU qj2DOMflTQprH6+W8m7buQHnC1j+w5ruKDdx+HK9nZ/YLklkjXOu8+UCKAalGhy4/hxk Ko2w== 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=lgLe7sgvzaU3jF4XA+SfoE2vippSYThYf8kMVph3yKg=; b=CFjZoKgPXNBwwTzKVui9ypRm/3zjejq4ByPwAs6Z8D0updfMQihbEpvod8UKtbX5K1 jB+vm4QMq3WxtOF6DPDd1tnNds4ysouSqrRpRZUXuzM7Kfsza801lRe9f2ybsKMlDNQd SSqEcumAYFmyziBpM2OeRycMZJLTaqaDmxy+Kh+gOkcQfyWHY0OcBqo1zglL8htPoSbR Zef8i3Hbn7ldqJGUd9CaW35Xgj4pW28cUnpizkpNJiKoM75JPgHsda/CscaENeiqvXnq DoMC7F1AigdrL2iojZQ0BXJ1YuhlkPUjQY6KtUXWIWHkN7i2TkWUOtEOrlkNBJO6y4fL qdpw== X-Gm-Message-State: AJIora/SPraz3w5wYvyRIBqCNoDChrv/LajfZp9SjfNS+WgqoXqK/Bgk CGhzG2J26MSfl/OyXDjKrZLiKA== X-Google-Smtp-Source: AGRyM1s76+7yXYHY4OonT2tDvEKKanbOE7ybrghZycJlv5jGCG8SfZR8feV7r8VD6klcmdzRR/UXMQ== X-Received: by 2002:a05:6000:1f93:b0:21e:ada7:7d1f with SMTP id bw19-20020a0560001f9300b0021eada77d1fmr5939832wrb.555.1658955829704; Wed, 27 Jul 2022 14:03:49 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:65a8:ebd8:4098:d9d0]) by smtp.gmail.com with ESMTPSA id h6-20020a05600c350600b003a38606385esm37908wmq.3.2022.07.27.14.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:03:49 -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 , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE) Subject: [PATCH v3 16/32] thermal/drivers/imx: Switch to new of API Date: Wed, 27 Jul 2022 23:02:37 +0200 Message-Id: <20220727210253.3794069-17-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727210253.3794069-1-daniel.lezcano@linexp.org> References: <20220727210253.3794069-1-daniel.lezcano@linexp.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220727_140351_539261_8FB5BA68 X-CRM114-Status: GOOD ( 17.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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/imx8mm_thermal.c | 14 +++++++------- drivers/thermal/imx_sc_thermal.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c index af666bd9e8d4..e2c2673025a7 100644 --- a/drivers/thermal/imx8mm_thermal.c +++ b/drivers/thermal/imx8mm_thermal.c @@ -96,15 +96,15 @@ static int imx8mp_tmu_get_temp(void *data, int *temp) return 0; } -static int tmu_get_temp(void *data, int *temp) +static int tmu_get_temp(struct thermal_zone_device *tz, int *temp) { - struct tmu_sensor *sensor = data; + struct tmu_sensor *sensor = tz->devdata; struct imx8mm_tmu *tmu = sensor->priv; - return tmu->socdata->get_temp(data, temp); + return tmu->socdata->get_temp(sensor, temp); } -static struct thermal_zone_of_device_ops tmu_tz_ops = { +static const struct thermal_zone_device_ops tmu_tz_ops = { .get_temp = tmu_get_temp, }; @@ -165,9 +165,9 @@ static int imx8mm_tmu_probe(struct platform_device *pdev) for (i = 0; i < data->num_sensors; i++) { tmu->sensors[i].priv = tmu; tmu->sensors[i].tzd = - devm_thermal_zone_of_sensor_register(&pdev->dev, i, - &tmu->sensors[i], - &tmu_tz_ops); + devm_thermal_of_zone_register(&pdev->dev, i, + &tmu->sensors[i], + &tmu_tz_ops); if (IS_ERR(tmu->sensors[i].tzd)) { ret = PTR_ERR(tmu->sensors[i].tzd); dev_err(&pdev->dev, diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c index 331a241eb0ef..10bfa6507eb4 100644 --- a/drivers/thermal/imx_sc_thermal.c +++ b/drivers/thermal/imx_sc_thermal.c @@ -43,11 +43,11 @@ struct imx_sc_msg_misc_get_temp { } data; } __packed __aligned(4); -static int imx_sc_thermal_get_temp(void *data, int *temp) +static int imx_sc_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { struct imx_sc_msg_misc_get_temp msg; struct imx_sc_rpc_msg *hdr = &msg.hdr; - struct imx_sc_sensor *sensor = data; + struct imx_sc_sensor *sensor = tz->devdata; int ret; msg.data.req.resource_id = sensor->resource_id; @@ -70,7 +70,7 @@ static int imx_sc_thermal_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops imx_sc_thermal_ops = { +static const struct thermal_zone_device_ops imx_sc_thermal_ops = { .get_temp = imx_sc_thermal_get_temp, }; @@ -109,10 +109,10 @@ static int imx_sc_thermal_probe(struct platform_device *pdev) break; } - sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, - sensor->resource_id, - sensor, - &imx_sc_thermal_ops); + sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, + sensor->resource_id, + sensor, + &imx_sc_thermal_ops); if (IS_ERR(sensor->tzd)) { dev_err(&pdev->dev, "failed to register thermal zone\n"); ret = PTR_ERR(sensor->tzd); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel