Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp23896imn; Wed, 27 Jul 2022 14:06:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vB7VYkSd1s5p392Blv4eANe2Gex0ou3qDVoI1KPwj3S/sFmJHAe2zrFU2aYPzCVOwpNy/9 X-Received: by 2002:a17:907:60d1:b0:72f:42a0:f3f9 with SMTP id hv17-20020a17090760d100b0072f42a0f3f9mr19072714ejc.727.1658955978836; Wed, 27 Jul 2022 14:06:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658955978; cv=none; d=google.com; s=arc-20160816; b=O35lxmeHxuFZbsgf6lGIWa01YmmijilZSt8aBBY6g83LB711gHuXo1EQf4Ve0HI/fv Jgw/bFdPsYnol/l4Ta/93qihkz7fxupmo3WnDHEcYKixT97WRvDd+z+kEgCwAE+XnflR 4OlVwB8TRL1gEguTWiw5/ir5owm7Bj4WmWj/CkZdJetTrSGHBcpR8pi9D0V6j6rnxsGE omVxmbWd7AWvjLmd/Vc5NLkRcnhsVHaMEF+0AHAZ8Q9bASHUR4mlU1pt8Dz415woY++t e0k89MY2000Ns9eZrgQo1Ws4uP0HOvw1GpfYEQHDDEBJoleqNKC36CHfN++edTNLvbzH 6K5w== 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=YLbrdXUnmrQegHQ4ArILFVac507m4xUt/E4MiWL2p00=; b=VTBqfTcnnMwkltIsABEE171WIlZkVaqWbiP8e6/3IfPCbj0ezaTsVBr8sXcuVwlzC7 X8JSTWCCLTZrhKxk+I79knCsl1tHct2reEIfcYQpnPn4rPC+w/4aI/FojSjwIcNPYnji OpPx9Cz4lZg7kglX3A2iniiQ+a5HUSV+RXmEH3LuVp8qo4u4r2u46pL+GROX3y5GZD7F fI4rNLLAt/A+Hvb/5nPzVMCO0k8B2zvMzsGDmMS+Ms9LHm7OG1aw146y51DBZ3BrPkme X1DHGXmkd6l5xN7zSONaqdqnEqFYSIpSUwkkkmMVGbVHvjNLLCBtdOzHhzFlG1iw+b9V gLRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=47RymGc1; 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 jt14-20020a170906dfce00b0072b54bd5feesi17406683ejc.438.2022.07.27.14.05.53; Wed, 27 Jul 2022 14:06:18 -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=47RymGc1; 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 S235986AbiG0VEQ (ORCPT + 99 others); Wed, 27 Jul 2022 17:04:16 -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 S234152AbiG0VDz (ORCPT ); Wed, 27 Jul 2022 17:03:55 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 652DC5FAE7 for ; Wed, 27 Jul 2022 14:03:43 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id v17so7137902wrr.10 for ; Wed, 27 Jul 2022 14:03:43 -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=YLbrdXUnmrQegHQ4ArILFVac507m4xUt/E4MiWL2p00=; b=47RymGc11nlAImgXbnxoetDsfvDXPpfxd/sUZKt+T2GBGm0k+GR2KX0yADQ3/iY8ZW RcEK9GgmSIyd504dayr0MWnP5oSwBF+vfbLe5/TNFY0Nkl3SmipU7lc5LSM8leX632L1 2GXMqhdHj0qgnYXW6yJ4lZHl1jvwsXuNUhEGPgCneSuTkaKpMtjjuquaBQJ9yFgz32Zt lX26Sh3qdOtmWRd4P/GQxfIM9C56IMpWSijIM3v7QCyltU05Gm4dKan4iaVqbrO4g4FB QJhiTJEpt9cp2VwNr1x2feETRj59X5WErwnqSJtL0Kd3i6xfqyfLcJ+DfJftafrJB0Q2 +64A== 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=YLbrdXUnmrQegHQ4ArILFVac507m4xUt/E4MiWL2p00=; b=7scacVVH7Qy/1LKwDMsG8Sa+60041+qGoZe9scuKMpiivRFWwmnYJ/sgKTH90y5jFY XrAQ7RhF0WRxq+ft6nQlv3ZUYVVm73J8rc3Mj6FEy3k5Kt59qhHkLkasCbn4eUMdWe48 rSHPMvL0cZGxDzFL6iFZrp3kEXvkvw5YsQGCCHnEnem6k92cCbRXqfd+a8pxPHgFu5K4 W7AJzJDuIli9Do2LGAgglJVbsAcqMI59rKNmcY5H9P66j5yy+68NJHmk/DSa/TlDUU/V ZOPrxu+RC1gLVmyzNXAVN9Qkb4fX+vpNU+IlzdgKtuqgRLqknpJgl8oE1kk9JlYQ6Vhb NJrw== X-Gm-Message-State: AJIora/nbsU2XrCrt0VmG/okoTBoxjba2ZY+L8LUgq9d8s1m1WOTIbX+ yp9l3+afQ2k9lU3N7yK/ivnS8w== X-Received: by 2002:a5d:58c9:0:b0:21d:9374:1373 with SMTP id o9-20020a5d58c9000000b0021d93741373mr15262679wrf.20.1658955822870; Wed, 27 Jul 2022 14:03:42 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 14:03:42 -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 , linux-amlogic@lists.infradead.org (open list:THERMAL DRIVER FOR AMLOGIC SOCS) Subject: [PATCH v3 13/32] thermal/drivers/amlogic: Switch to new of API Date: Wed, 27 Jul 2022 23:02:34 +0200 Message-Id: <20220727210253.3794069-14-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/amlogic_thermal.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c index e61b91d14ad1..d30cb791e63c 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -179,12 +179,12 @@ static int amlogic_thermal_disable(struct amlogic_thermal *data) return 0; } -static int amlogic_thermal_get_temp(void *data, int *temp) +static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { unsigned int tval; - struct amlogic_thermal *pdata = data; + struct amlogic_thermal *pdata = tz->devdata; - if (!data) + if (!pdata) return -EINVAL; regmap_read(pdata->regmap, TSENSOR_STAT0, &tval); @@ -195,7 +195,7 @@ static int amlogic_thermal_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops amlogic_thermal_ops = { +static const struct thermal_zone_device_ops amlogic_thermal_ops = { .get_temp = amlogic_thermal_get_temp, }; @@ -276,10 +276,10 @@ static int amlogic_thermal_probe(struct platform_device *pdev) return PTR_ERR(pdata->sec_ao_map); } - pdata->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, - 0, - pdata, - &amlogic_thermal_ops); + pdata->tzd = devm_thermal_of_zone_register(&pdev->dev, + 0, + pdata, + &amlogic_thermal_ops); if (IS_ERR(pdata->tzd)) { ret = PTR_ERR(pdata->tzd); dev_err(dev, "Failed to register tsensor: %d\n", ret); -- 2.25.1