Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp23272imn; Wed, 27 Jul 2022 14:05:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tzIxsfhwbBJ7wUcHTjO+dKzEexo/Kr2H+BVSP2D4yB/liOq3BMJhzBOsWlirStSBQzDm1T X-Received: by 2002:a05:6402:370:b0:43b:bb2e:a0c6 with SMTP id s16-20020a056402037000b0043bbb2ea0c6mr25035310edw.378.1658955921518; Wed, 27 Jul 2022 14:05:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658955921; cv=none; d=google.com; s=arc-20160816; b=DcJrxyEIJxOhVR6TBRH9CribundFrWk4Zgc0J3ZYXMOeL7Qc1FYUqRtaAYpsiOw8Gj j0BXZ1Au8+yvXLTEubLPCwEtjERbPtKx7cc3+LFYG6o8OPfE2xGPrq8B9ZXebGz/v3Q4 PgkGbNBJOaFuvwSZM3r82tN4uEN0UQa/Hxs3R8/Ppg/Cz4ctAwbKyxEyvOxcsz8LyFOO 75Ddxb57kdhNxLIElEGdm+HPqfqmmB1+ywQXt3ErWW7515AWqtc7MLHMv64JJnTgvK9s pgGDhjbYV1FyNTr8FoZN1cKnD822o6EGq9p6pGFFInHSzQFRVrfBOVnfQw3FGGEROd5g mXAA== 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=0/7L9Lc2wRZZo52YCs91vi96h8X92jsylQFQZGCnX0s=; b=IrI5BwgzfHtrSNe8LY5j1UO1cR0sUdH7oXMPFENmGvRlXUBl6I5OCDvApFTRD0/ZiA RcKAh4ddYyzw5VXGL7rsS5f4vMvRsjA0kivYEwTItvTLZqknANFktzak/FsLiGXUL3Hz V/ff420P++jXOP1f1O2c7pZDsR8AdihvDkeFRUYMSh7o2AHbwNXMjAmpqegUTcRivPtp cFyJxgh4MxhTUq8Ync3xtPHn84xZy2UUYfFj+MqHC4uOqEFzE+J/iI/tsvwaXkbVRmXA xqmRnKDsC2zdjEZYsOf4ibEua/xGdJv+K52A8V4KCUsB9QNxd/Wi8KJWbY/bwNscTqpb 99vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=4sLRSJ5Y; 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 s12-20020a1709064d8c00b00726abd9108bsi14103264eju.168.2022.07.27.14.04.54; Wed, 27 Jul 2022 14:05:21 -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=4sLRSJ5Y; 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 S234159AbiG0VDa (ORCPT + 99 others); Wed, 27 Jul 2022 17:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234215AbiG0VDR (ORCPT ); Wed, 27 Jul 2022 17:03:17 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6202156BA5 for ; Wed, 27 Jul 2022 14:03:15 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id b21-20020a05600c4e1500b003a32bc8612fso95046wmq.3 for ; Wed, 27 Jul 2022 14:03:15 -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=0/7L9Lc2wRZZo52YCs91vi96h8X92jsylQFQZGCnX0s=; b=4sLRSJ5YjVaF+p4XPUij0xfTtldIkLup8iWugu7Ph0U/Dd0PpdQR2TC3D2U7DFoCfa 0fKkLsC99/N9MIdSyaO7M0aHwuBtUebBOQw63iVNR5p6szFmCw1gruArlRO7+JJVGg7j rH9F/aHJUfswzBDidRYJQBKkP7SLbaFKr4B5CcUV/bUNqQVoSUnOYFSW6r0zbMmh880R 222/grZZnPNEHYz9bg55UrGffORniMp3cbYWR3yD7dvZbZqPMAJ0tQZ890VsGoDDUbN5 qSB7xmKlyQGkvD+J4mInC/yir5bX1b/UCYFVFdxq4EDTHAcG156hZOZAt7szPEcJSTTs sNxg== 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=0/7L9Lc2wRZZo52YCs91vi96h8X92jsylQFQZGCnX0s=; b=vdfbtW2RXqIaDOulGnWiRLTTORiAOHc0eTI/ABJ+DY8q/z/UdLQzujyU7HxkRXeo3N PD500uufp4YbXKWYYqWNXYwmfcIWfZ2cjZkYAx+SUzv3BU5DhAr1gQyWeuCxL4MSpruM 7/SdQcPRxZaALVkiRdGeDHjglDu/H6HgJTmW8w1pATp46bXob+nP8h53xeTz0wPtSYPR IPlsK2b2kn3N6bVelIaIIez+sJ85YqNlbGq2+taMIo/oKUsV8Voqtne+aAbaWi6+CPTW meNsO6QetlOkUXJ3ExSfDNhNOfVmG39gbqoJytF3FKDTizOHh615gKvDvsh5XTULRVvc INtQ== X-Gm-Message-State: AJIora/OG4g3qHYKLSqhD7y0vPtc6NnorOWhF8m2FCp774KqLCgSOEMZ Ebegf1pi+fi6y6d9QrREBZhsIg== X-Received: by 2002:a05:600c:1d1b:b0:3a3:e2:42d1 with SMTP id l27-20020a05600c1d1b00b003a300e242d1mr4240318wms.137.1658955794901; Wed, 27 Jul 2022 14:03: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.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:03: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, Amit Kucheria Subject: [PATCH v3 05/32] thermal/drivers/generic-adc: Switch to new of API Date: Wed, 27 Jul 2022 23:02:26 +0200 Message-Id: <20220727210253.3794069-6-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/thermal/thermal-generic-adc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index 73665c3ccfe0..323e273e3298 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -52,9 +52,9 @@ static int gadc_thermal_adc_to_temp(struct gadc_thermal_info *gti, int val) return temp; } -static int gadc_thermal_get_temp(void *data, int *temp) +static int gadc_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct gadc_thermal_info *gti = data; + struct gadc_thermal_info *gti = tz->devdata; int val; int ret; @@ -68,7 +68,7 @@ static int gadc_thermal_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops gadc_thermal_ops = { +static const struct thermal_zone_device_ops gadc_thermal_ops = { .get_temp = gadc_thermal_get_temp, }; @@ -143,8 +143,8 @@ static int gadc_thermal_probe(struct platform_device *pdev) gti->dev = &pdev->dev; platform_set_drvdata(pdev, gti); - gti->tz_dev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, gti, - &gadc_thermal_ops); + gti->tz_dev = devm_thermal_of_zone_register(&pdev->dev, 0, gti, + &gadc_thermal_ops); if (IS_ERR(gti->tz_dev)) { ret = PTR_ERR(gti->tz_dev); if (ret != -EPROBE_DEFER) -- 2.25.1