From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6471EC00144 for ; Mon, 1 Aug 2022 21:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bQqY9i+U9kzOxvuT9u0U+wLiUtXJhidJefrP7pyvS5g=; b=wPhuJZWYCmaf0i AaV/Tc0rBPIA4Wg34f81YDBwOTj+CiJIsnQKdvI/N2vzmuPDcg3aI1RUjUGrcBRdk1/+7yAi68UoP 6uR7DUyhzzWiJmBJQbCbXoeqqtZGb8mHnAiQGvc4Uwpz0zwFBVwRKDlnxtA1PwbYjazduPPUQirYj 4RLf05z4O8norKDtAIa0O/oLMy2OyEhC5ON4FhljWkCSLke9ow7p01p7Qp7foNxUfu2lQbA7tDU2T XXstWmTMAyjxTvy4UXV+MnVfnhMsa+698QaGsyjkQKmwDM74uHg7G4mcb0AFHXtWB3c435nnNZuZc qBASOJcwPcVrEzHSGJvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIcw4-00Ar1b-5w; Mon, 01 Aug 2022 21:26:49 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIctH-00AoeJ-Mw for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 21:23:57 +0000 Received: by mail-wm1-x333.google.com with SMTP id j29-20020a05600c1c1d00b003a2fdafdefbso6128859wms.2 for ; Mon, 01 Aug 2022 14:23:54 -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=L4UmdiarPTefVBwi84qDvHxLHs+jxibvvgRdddv0VKQRgS5LYxRf//uN5WCq4fJJc3 H+ZF3HNB+s/0DzKiCv+91u1OkCRyBlxESV4f+rBjuF1i8V1Ec3dhxaIhn2hKzfh/I3s9 rALN3UPUtaVszMgXgyU95Z1pxVd+Fr2HaXV545B38Gpf1otgjq1arsmmrmQ1C1Sx7+3n W59+/lt0ICPtW1uODSY3HYZGdfL2IAPzaaUZAi6ZiE8tgTNY4JUeZLQQn8G7A8fgIIya qlL6TgmDT95c7JGtkaivSL+z4U/DZPpJXX2ZXpT2DdiXE5sUmusNVqmxuauEp61lyL+3 DC1g== X-Gm-Message-State: AJIora89ta3SoOT93yUCFTI7xIvkpFSESUgZLvYjLAkgcEr92Qs/X5Vj ZOhPzyLLhAjlgHY9lbbV7Q3OUw== X-Google-Smtp-Source: AGRyM1uTZwUpQEaYRWrwPXVH9yL3knEa9rHrnPWrav0skfCkU7duYBUYLF6MpM0OYOmhZIIYohUWAg== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220801_142355_774808_662A5B79 X-CRM114-Status: GOOD ( 16.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel