Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2192293imn; Mon, 1 Aug 2022 14:48:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAjnMYnj0VpuHpYIAEojEePZQfY5uBVXxrxL8CRPgLvGHW5vLI9DM550ZAF3lfVpUfJumU X-Received: by 2002:a05:6402:3693:b0:43d:1a40:21fd with SMTP id ej19-20020a056402369300b0043d1a4021fdmr17213296edb.206.1659390516967; Mon, 01 Aug 2022 14:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659390516; cv=none; d=google.com; s=arc-20160816; b=AATvnahtxGX1M70XWWVxdAH64mc1p7UW1H11Cqu5fmq5xhEtZ/Vjq9Ca74ceeW3f9v zZFJkf2OsV4UzqoKJLMCumpfobjxLbC5nB6X6QWsqSb8TUwrpT5yhUjap8nSspORTYA2 alZyk2wkw95HCC5d+xpc8pvg9fiJbWZaBNMui7LFukK/cwF4209LMPP0xrsw+SooB3dn Ek/0aqdZzk+QJH3jRt1eBR9x65dRAqw4bmKDo3mmRmI15twzzY+OgxPlQmgU/CRJeqJQ tLsXxr1zitoy4GNfoa8DwA9p9Qz/IOCpszwwPbSCNgmJqslC2GdBl5hxoyxqOUX1L1HH JTKg== 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=kR3Ri+u8MrlBR31H9vhYMnYhYm+SNLRNtOs1Gp5xhCw=; b=BaIZ1beHMWGK87eeHhsJsfp+RNLtjav52wq/e86fhY6J2OXjuJRYaigJ4TZFyMQoAI FRfWhHSFi3/QdORzQOMzSpBBRYUPsSBm8ESu058XGnzizJUgIeaKeJmmhEl77kZft01A clYIQhkVY1I7gpxPjXAQXnl3EatsvaFu2bCUkBvTOFgBYn6De8fSp5TLUxTve1e8k6k6 LeKZlsmlaVcSb/nIS8i8Yfj1UnUkW/natqs5zb13xFItdoEVPG9o0KKkqX3Y52mjXcZN v72AKTs6H5z/3GRrQ6uA+nNpzNUFc72Li6Sfj7//0ojS/nWEHv5KlzP+vCR+sP4rlfmS uSDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=xh8Gu6Cx; 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 cb8-20020a170906a44800b0072641df559esi9497695ejb.864.2022.08.01.14.48.11; Mon, 01 Aug 2022 14:48:36 -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=xh8Gu6Cx; 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 S235280AbiHAV0R (ORCPT + 99 others); Mon, 1 Aug 2022 17:26:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235055AbiHAVZY (ORCPT ); Mon, 1 Aug 2022 17:25:24 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4201448CAA for ; Mon, 1 Aug 2022 14:24:09 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso8021960wma.2 for ; Mon, 01 Aug 2022 14:24:09 -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=kR3Ri+u8MrlBR31H9vhYMnYhYm+SNLRNtOs1Gp5xhCw=; b=xh8Gu6CxZR+eHCxOmg5DvWBOkqxPXW8WLgkpaNchDUH5lQyH7yxJcrq5lgw85+W7VH RIbvm50Fu7/2MYWwdSa19QbfmT6UphVTPkuOnjmQGh3SZkccXDK4vW80VyV7h3WRJTSo VQutQv0Y4cr81PHha3zpny1JbqRcIXXcbBXk/sx6YgKgp0aDX2oULlAeBZX0yFw8dkcP xBf3RXZBss3INtEoO4bZQWBYSslKyoxDehwFDEeWsXMgaTemsPEqdW8Xl43of9/Gsxtq AqoL+V/lNNNQEePgCMo/Ux/avVQ1Dah5/+B4qr/uS3PjTQ/cpLcOJ9iqk8CBHCrVLvtt xJ6g== 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=kR3Ri+u8MrlBR31H9vhYMnYhYm+SNLRNtOs1Gp5xhCw=; b=NjNCEzyo3bYCepeu8B4tVjp7v2gkLiLgxwIiB4Mbxjd1pV3bEyBo5n9IU7Lg7FTYuA 5fnQuT6dd6fLWo5ErT6KXnAwGEPvNDApfE1+p5WAtwrHCnMbFbAjKvzHENtGHi+oW5Fk nSEcTNlTmHxsjGEPVImE2YrrmBzrQpAxmVRReDtmUyHnHx1JTfd1+nvAjcP0wEYm++HD dHhB3vawSMDvVHW3GqKjpX9xGQiQUEXeTKFZNz2t3Xe9+968vScJbVhlQNqEHCro+EDw qTydvd05Fn3pusyguI2tFI93fvFDh6d7j9mnLyVB4Mxgb8qE/ZwCOx2B704QHwQmssFd PxsQ== X-Gm-Message-State: AJIora93R2Z+EZdiV8fE5uYphgwqswTqbBaRXo/Pz5aPeUMOpWqDW3zw ImA9CCCWoJWCEs+LeO3dzfDlKg== X-Received: by 2002:a7b:c8da:0:b0:3a2:ffd2:8059 with SMTP id f26-20020a7bc8da000000b003a2ffd28059mr12277872wml.169.1659389049153; Mon, 01 Aug 2022 14:24:09 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:d00:ceb8:9c09:1302]) by smtp.gmail.com with ESMTPSA id c7-20020adffb07000000b0021e501519d3sm12995285wrr.67.2022.08.01.14.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:24:08 -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, Jonathan Cameron , Jonathan Cameron , Lars-Peter Clausen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-iio@vger.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-sunxi@lists.linux.dev (open list:ARM/Allwinner sunXi SoC support) Subject: [PATCH v4 27/32] iio/drivers/sun4i_gpadc: Switch to new of thermal API Date: Mon, 1 Aug 2022 23:22:39 +0200 Message-Id: <20220801212244.1124867-28-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220801212244.1124867-1-daniel.lezcano@linexp.org> References: <20220801212244.1124867-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=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. 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 Acked-by: Jonathan Cameron --- drivers/iio/adc/sun4i-gpadc-iio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c index 2d393a4dfff6..13d1e937357c 100644 --- a/drivers/iio/adc/sun4i-gpadc-iio.c +++ b/drivers/iio/adc/sun4i-gpadc-iio.c @@ -412,9 +412,9 @@ static int sun4i_gpadc_runtime_resume(struct device *dev) return 0; } -static int sun4i_gpadc_get_temp(void *data, int *temp) +static int sun4i_gpadc_get_temp(struct thermal_zone_device *tz, int *temp) { - struct sun4i_gpadc_iio *info = data; + struct sun4i_gpadc_iio *info = tz->devdata; int val, scale, offset; if (sun4i_gpadc_temp_read(info->indio_dev, &val)) @@ -428,7 +428,7 @@ static int sun4i_gpadc_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = { +static const struct thermal_zone_device_ops sun4i_ts_tz_ops = { .get_temp = &sun4i_gpadc_get_temp, }; @@ -637,9 +637,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); if (IS_ENABLED(CONFIG_THERMAL_OF)) { - info->tzd = thermal_zone_of_sensor_register(info->sensor_device, - 0, info, - &sun4i_ts_tz_ops); + info->tzd = thermal_of_zone_register(info->sensor_device, + 0, info, + &sun4i_ts_tz_ops); /* * Do not fail driver probing when failing to register in * thermal because no thermal DT node is found. -- 2.25.1