Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp42319imn; Wed, 27 Jul 2022 14:38:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+eeTqGtVQ14v74mOU+IsjplG7b/tI05qXPZ48EmfGudF8gLCor99GX1h2BoNILb5CqhyX X-Received: by 2002:a17:902:7290:b0:16c:cbcb:3971 with SMTP id d16-20020a170902729000b0016ccbcb3971mr23108510pll.165.1658957904370; Wed, 27 Jul 2022 14:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658957904; cv=none; d=google.com; s=arc-20160816; b=cuD9E1ZEFUO/KOLtsXwF44quaKl//6y/bbkf9RaVRxwsFCDxFkyLnPefhni9yEmRFt 3tEzqHeLqfAObeQUzpifx6DMVInDKAoJj+dccHxakLC3kUGKeLIn2l7a1+g4GPv3050P FYczxmE3ol587PI6nlidSlVx7mFc3DDFbq4oPYah4jaSxQ2NsBQzqqvb4OJ3XOJVHjms RPZCMgLH8uA/AZZfBxiL1wy0lmrx7IyPlA8mMtNaB+CRF3wqgDayQo99RROlmRyJBsL8 /Vog8S/K7ieH50QmtE0L+ki5S3pFz/ei5J+dc1EqnHs9RpAigkCVNrheMmZIGFIUSvT5 r87A== 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=hWFZXwysMvsN10lXDK6sChpf4X2qhnFs4AeSH8mvwTs=; b=KW3Lugalb/xivcwjUYxLqnZzp//iGUcB/TgBRF6YiRm+wodTBF9A+6PDWDco9o349S /ou4h/9RcfYiSjeVOtTmkWHeh7UFCTE0Kuns2Uppak+4upNMWIl9Y+xB0QCYSkWxzUqy S7NInTucqFIUcaRlinwcaLVwFwwrNel0Nfz0xZRkj1nw/11PDz3HJS/cXdM7hOhYYXKh RQ/9NXhosoz9I1i5DS9aNFfgS3ZwO+zV3mnfeAiKHzfF/Cqzf6VqCb5s0bQV7gUoU4ah 9MWdAAk/l2k0N+umAJQrqX/+waNFMaGnpmY4BuSSWxfZRcUfUwX4QNjME4zjHiGpnVjp sumw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=fKlk36kN; 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 q4-20020a17090311c400b0016d2c5285e4si23505990plh.413.2022.07.27.14.38.09; Wed, 27 Jul 2022 14:38:24 -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=fKlk36kN; 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 S237586AbiG0VGL (ORCPT + 99 others); Wed, 27 Jul 2022 17:06:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233832AbiG0VFo (ORCPT ); Wed, 27 Jul 2022 17:05:44 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCB1B6172E for ; Wed, 27 Jul 2022 14:04:21 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 8-20020a05600c024800b003a2fe343db1so106629wmj.1 for ; Wed, 27 Jul 2022 14:04:21 -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=hWFZXwysMvsN10lXDK6sChpf4X2qhnFs4AeSH8mvwTs=; b=fKlk36kNOIXutyiEJaCv7Gy8Y8SXPlCpXEpYT3v5hsMHepohYOURnllehr0xqrdsih 078Fcvs34wsDW8L5O5Pd7eWtz38QHUh1HtvR4zooK/5hbc97+Wmqbny72ol7qEj20n3v GJV9ONI+/SmPBwYp1ysGn6xl2li8XJ7rlA9/L3pzQVAH9NdJeieQevx7mwXWpqjgeSoa y3rBAk4q3yoQrnxQHvFy1QFxG2EKnxE9CDr+o4Pfk15EcgVvqz2DQxJyuis6Eot8avz/ 0qyxFLygD/WvXkzaPZoOgQu6Nur+1H3zTbzuIy0Cw3V0q/rP5rk2p5z1Bc3boCtnkvAC qrHA== 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=hWFZXwysMvsN10lXDK6sChpf4X2qhnFs4AeSH8mvwTs=; b=Li3VwkJc9ZJd6Vom29lARH8OxeJ/VkE+W0WGU6X2etB7C/XeKmrlbzzz4Pij1xSW1u KO18zd3MJLNrNh+UZVpxi2eRO8pHznJ8vrqZqSJ+Y+ryFzH5bH9K7ifg+ijVv+aAAthp w015MxBQ1T2bMXjqsaUlEue3drqy9ZQtr+//QG7bPCrXgOzZyB+S431XlT1PSGbnzB3v k7jiccbSXFq1YrmjU0D9LzorG89Op1kEwjOQ2sAOr6EGP/ja/bQJqcSX0Bi188xPpuzm KADz3ZrMNiBl41XA+i+HwvzDqi+mQwchLyBk9K619ScRYmvtoOv898ZXs0OB7KuZ3Zk9 hbnQ== X-Gm-Message-State: AJIora8jJ5QMgncUyn9/TVcrK7FO+VQlKsyT91c0derdhblikTWin4ov vsq0VrrrRthDFo9c3m8RWXHqRA== X-Received: by 2002:a05:600c:1c26:b0:3a3:2251:c3cb with SMTP id j38-20020a05600c1c2600b003a32251c3cbmr4353158wms.126.1658955854767; Wed, 27 Jul 2022 14:04:14 -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.04.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:04:14 -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 , 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 v3 27/32] iio/drivers/sun4i_gpadc: Switch to new of thermal API Date: Wed, 27 Jul 2022 23:02:48 +0200 Message-Id: <20220727210253.3794069-28-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 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/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