Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2751477imw; Sun, 10 Jul 2022 14:27:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmP9QjquBiV6b8ET/BuQuuJtifHvU9IcCTUByTieVYoFjL0/VPLTz4xXjYfjnHPkZ43pfZ X-Received: by 2002:a17:906:5a5b:b0:72b:39cf:6042 with SMTP id my27-20020a1709065a5b00b0072b39cf6042mr8690764ejc.301.1657488463281; Sun, 10 Jul 2022 14:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657488463; cv=none; d=google.com; s=arc-20160816; b=fFYkjWBuYrtTW55Qpr8mERUHnUzxfcDKLHU6n+taMhiQDbu8CcLgMWC3byBme2Iy9l buDI/4hgc8HmmlVeTMPqCkzrDNgm3YSHG87GO1MTYm4YLUdspHdozOnjssoVgTIRNESZ n3AXB1vKIUApF22xElJ3jf27Ew+IewdexsyK0sElw8QJS4LlslDKP0lpG4iomz2uKtHV 8IiaytFdjsHk/QhPZLs3Ez7VruXwIlZFtI13LARG5cBj/wl92ar7wMCSbhzPpSJ1S9c8 L6T4Lp79+2tElwhuunrXP+7EJjVzVaw+2OB1Dt/X1yREz8Gp51JsSH+pYZDf7+1JfGEh VrfQ== 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=tnXyKJKTkBqGsiKUGhGkbeXFD6onb5fWswWwbVX/pFQ=; b=MMwzJlSADP85D48Z5Hb26EPMcN8Q4lOfWgKHxDHtwJKbCHghFxsGZ9KLCZW0jbzHDU FxI5fNgsihYy/6UOwnzAMosnpKSCPslI/5gmeb8selORYpDf0EugXr8WHjytV50R6N0R DVc+W9rIoRClI8sm+vvkAFIg8Ym4N72KynACQg8YnWxxhorcwaxREysTVxa4sy6Onn/B f7KSYTjMxYlllVlTMCpChS+rby+iFr3Td+29j/6oTXaOA0O1iVxhb3ounLYUb0FavBnB z0n49aE0sKB3Zehg7pDFeBDroMGVsEqFy5tbTndhkO/jHFSlLMP1mukZtM6ASGgRkVBx nH6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=vhcmz0M9; 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 dy6-20020a05640231e600b0043a6d3e827bsi7226892edb.119.2022.07.10.14.27.19; Sun, 10 Jul 2022 14:27:43 -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=vhcmz0M9; 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 S229739AbiGJVZy (ORCPT + 99 others); Sun, 10 Jul 2022 17:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbiGJVZW (ORCPT ); Sun, 10 Jul 2022 17:25:22 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42F4A16596 for ; Sun, 10 Jul 2022 14:25:05 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id b26so4774176wrc.2 for ; Sun, 10 Jul 2022 14:25:05 -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=tnXyKJKTkBqGsiKUGhGkbeXFD6onb5fWswWwbVX/pFQ=; b=vhcmz0M9eUi9D6XilJmP7d+qZHjtePvRIgrxmbiJk3imnF2qznCnLNs/dVzU03K+Za UjI1IJoJqhQ45tR0vzWPXWm7hP44ljUMxNjPG53CYFx2K2F6jEqr60Ch6ugZV+JFPipd eD68GXaBoUaZ9aQDpEBcTCQ8Sk4FaC2MVpWAupJMATt5cwyRb5wY5NnZTygSfM7Azn6d eZPxv4C/l4jFZJgWT7Stnn2C54hkpFAEy2Rcqdp/aUzlOf3eENQ8CTgvIFYfkDi3b2ug 13Y4rqvPYuMbaMxnjHy7UvCtDatLKSbauRWHKDpAgebPIjQs/tpFdmO3n6uky+EksNtT 2k6Q== 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=tnXyKJKTkBqGsiKUGhGkbeXFD6onb5fWswWwbVX/pFQ=; b=AhptXNDDu8jr0lfYnhXSEHpcALC8oSYlB+6sCG3V/lPftm1setPlp9AmJJ//sqMWtJ 49uLCm4XcKzlmZo44339krQ3Wfe0/RdvrRWLnUYMhuh01x1UC2M5vkZL+rhwZGlG6g8E HzdTMkekZ/HJkAgX8m1o9sYvsEmVtbSDTgQmlZkhojbE+RRqJrgQeoj0Kha22/KsdDQw TjezSLLyYyACIc0p0nplT1UJUiBoXrlgxWAUG5xSjQpJITCKg1zp0NJz36s6fjznNU5e 2KS5AVudAwRxKO6WJXP4hdQFBfWWbnXkj/BKY9zJsi1EUSGvwENpTyvPf+ntmc1t1vgb qD9g== X-Gm-Message-State: AJIora8UMlHi151Dk2NvP9cZY/Ps88s6/BiQrIbCmfZCpd78Vfe/3IYW q5J+PrnMZ3UzNyL9pt9h3HoRYZJaZd6VdA== X-Received: by 2002:adf:e30b:0:b0:21d:8f3e:a370 with SMTP id b11-20020adfe30b000000b0021d8f3ea370mr13587114wrj.124.1657488305467; Sun, 10 Jul 2022 14:25:05 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:c7c0:6823:f3ce:2447]) by smtp.gmail.com with ESMTPSA id m19-20020a05600c3b1300b003a2dd0d21f0sm7142759wms.13.2022.07.10.14.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 14:25:05 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, khilman@baylibre.com, abailon@baylibre.com, amitk@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Shawn Guo , 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 v1 16/33] thermal/drivers/imx: Switch to new of API Date: Sun, 10 Jul 2022 23:24:06 +0200 Message-Id: <20220710212423.681301-17-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710212423.681301-1-daniel.lezcano@linexp.org> References: <20220710212423.681301-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, T_SCC_BODY_TEXT_LINE autolearn=ham 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. Use this new API. 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..90992eddd442 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 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..773d02b043be 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 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