Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2192611imn; Mon, 1 Aug 2022 14:49:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sfpqoPe7z00cpgWzc2mDYkdd3k2g4lYETFQOKvquEfAcShv1qwHygQmMQZIDVYd3YMHuMh X-Received: by 2002:a17:907:7f05:b0:72b:5a11:b357 with SMTP id qf5-20020a1709077f0500b0072b5a11b357mr14262197ejc.67.1659390550730; Mon, 01 Aug 2022 14:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659390550; cv=none; d=google.com; s=arc-20160816; b=M932ML74nWRc8vZvMd1cY6VqRFzOTQn5iyAPXxJKO8AVitoPFVsv/hdp4Avc1KKoxN PbtFrn9GoSViPErtNzodzWKHYIDP/8uVTSy2ZZwM97uZTy8OeoF6EZPsrcIc0ANncgx2 9sQRJ5E0CayG4Y9L10CDotYAuwnNphp5UJYHVbnKKgWU/6BS8gowQB2X36l3cDs8bd1z x+OLyL/fFMquNYsQzXahdCSunabgH1nGPtwTx3iZDlJJglW4tYvGxMsDr826+f+UGors lWi1Y9hy2sxJhDTLu8iTy3Cv/3GyT0qASE9YD9//ZCWWCxKrc32xV9URt1HiBEsdHpJH AK+w== 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=f4QJf8ruUt+YX0IWOG7trN4ZQXuWHdSPHvGfzpjTqBk=; b=y5djV0apzo0lH8o1tRnxN/7SjIIq2wyvOpjE5QEz23rgoOhjBHwfMo/PRCIESyzs+M qf6w3HPDK6/Efq0PWpxwoy6FQDzz8Q808ZkizbZ54arSvUJ4FpXMErwa7PB2PK5n7KzX xtZf9rE4+q90oWseGzCGM0xYrl1l52kl/YPsxSPC0ZWRNmGYJfU9DyC+aepdVGfROXeR ZcIJCWYJmroNqu3P6FLfIfugbeNx8A/bdnrNKlmQiuNwll1v8FLKVoI7QOOeovf9PtMa G0ufsb5YNKAkczb4pR0IXPud27mCHkHkm/O5tXqljJFo2eJIUW2YDplwWBmIB3bI0fv0 XuVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b="7kH/6Bqf"; 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 sg40-20020a170907a42800b00730756b60adsi4640226ejc.367.2022.08.01.14.48.45; Mon, 01 Aug 2022 14:49:10 -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="7kH/6Bqf"; 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 S234201AbiHAVZc (ORCPT + 99 others); Mon, 1 Aug 2022 17:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234450AbiHAVYh (ORCPT ); Mon, 1 Aug 2022 17:24:37 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B1A45F42 for ; Mon, 1 Aug 2022 14:23:56 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id w8-20020a05600c014800b003a32e89bc4eso6126717wmm.5 for ; Mon, 01 Aug 2022 14:23:56 -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=f4QJf8ruUt+YX0IWOG7trN4ZQXuWHdSPHvGfzpjTqBk=; b=7kH/6BqfPqfHpgF8aLj2FxU0sj26orMDLECovpm9Mw+K0JKZnb6mCayg0PRjUmls1A nnGDzn26KAy5XS39Imqv93DqLeI5kNje/Rck1xUra2u0D4f/yw8Ok3afaz+NP5TQ/F79 PMH0DU/lImmWY8EeTJvk96OtXqpkbtt5zAxM5EbrK/AahDFO5LQdX1/3BPuQ//rPOPMm awfnWAoP14/MtAED6eZRRiAGZoyLNDSIRdS9Ouw+RCud8mtXS9yPhtPeBp/PdC60zfDc Se6wYL0O9CFkqbjNesFUQevwI3FfNR0wNEllv9MFxxwt4W4lB4MlSnNEXWTWbP9ssamw 76hg== 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=f4QJf8ruUt+YX0IWOG7trN4ZQXuWHdSPHvGfzpjTqBk=; b=3UHt/Yqc8TBo2sI+nFAeb+qChiADJeLt8BCI81IIzw65TeYDvY22U9ny/ieJpz36bH yEnKdZlAU8m+wLonR2Kyzbf+K2r7tW5qNkErNQcrLdFMgNxS8Xig03nbiIYbUYpYXk2B ZBUZfYAzjGMf/C+yHh8QZrH+GlBIVipGyNVnQGswy+p0jTHJcu+2sH+mhHoVr/J7Gokk ZiGCM6YdPxQruSRO743d8RQ7k2IkMO5QsZOi/0DSwlgzEjSGwKjFqy5xIAuNygEpSBT+ GoxYQHLyOWfdKUUzpJS7rJPikfQ3AGAuzSFXiKb52aQ1kDWJ1sL9Y/uw7IGJqfTU5Z5v MSDA== X-Gm-Message-State: AJIora9skNDcbhQGH94coMFsgznyMjAkAXZ356FhWn4/9sRINF4fBhkt FL0E0gooAdAmEhgRVdNuo08iTgBC8vzF7w== X-Received: by 2002:a05:600c:354e:b0:3a3:2ede:853d with SMTP id i14-20020a05600c354e00b003a32ede853dmr11710444wmq.61.1659389032980; Mon, 01 Aug 2022 14:23:52 -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.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:23:52 -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, AngeloGioacchino Del Regno , Amit Kucheria , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH v4 20/32] thermal/drivers/mtk: Switch to new of API Date: Mon, 1 Aug 2022 23:22:32 +0200 Message-Id: <20220801212244.1124867-21-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=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 Reviewed-by: AngeloGioacchino Del Regno --- drivers/thermal/mtk_thermal.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c index ede94eadddda..8440692e3890 100644 --- a/drivers/thermal/mtk_thermal.c +++ b/drivers/thermal/mtk_thermal.c @@ -679,9 +679,9 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank) return max; } -static int mtk_read_temp(void *data, int *temperature) +static int mtk_read_temp(struct thermal_zone_device *tz, int *temperature) { - struct mtk_thermal *mt = data; + struct mtk_thermal *mt = tz->devdata; int i; int tempmax = INT_MIN; @@ -700,7 +700,7 @@ static int mtk_read_temp(void *data, int *temperature) return 0; } -static const struct thermal_zone_of_device_ops mtk_thermal_ops = { +static const struct thermal_zone_device_ops mtk_thermal_ops = { .get_temp = mtk_read_temp, }; @@ -1082,8 +1082,8 @@ static int mtk_thermal_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mt); - tzdev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt, - &mtk_thermal_ops); + tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt, + &mtk_thermal_ops); if (IS_ERR(tzdev)) { ret = PTR_ERR(tzdev); goto err_disable_clk_peri_therm; -- 2.25.1