Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2191247imn; Mon, 1 Aug 2022 14:46:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uBuqOgtOA8XRXHyaEGJpguvK8lIYKS/pVbs1uX7vbsJDp8AWjoyVH1qZRjJcawjho9kNWG X-Received: by 2002:a17:906:58d5:b0:72f:2b21:eb20 with SMTP id e21-20020a17090658d500b0072f2b21eb20mr14041925ejs.508.1659390382300; Mon, 01 Aug 2022 14:46:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659390382; cv=none; d=google.com; s=arc-20160816; b=ZVfYlVa0W01zap4AkiHcrDOYrm1OtRdoz6AUrRaooO16dkZmrU7LfJzba6JoooG5O5 +EsdHF6XEGU0pzbA0MN1Sm38KgXU/IQOYuCdgXZF1IQEe9OsTJf7u3byNukXoo3IeIUu EBHFTSiQEpyzs45UoquT95BWclMuNu3ERbdS3O1e+dbbhYE25GH3ro8/3Pb9qaewiG+c VZ4o0aimWfjIPXTqS6Ge0e4VvFbmyykh22P3A/I3/ch1j5coRfWbQ4t6bvb0VqE+fFn7 rD2w5iux61CcbUZ4RG2VR5nGkbEIWu+ISW8gLUkBjrivAFSH3jkfT9uz4H86G3SvjkcR t28w== 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=bjRNYXxMr1okCGj2grS3n0YP83rNlXVFleMjal7EwMQ=; b=0ZaPSwknq/WOyVMtc71kiJM7NnjC9oVdsa4I0ktEpaOosxLA9DRGxHRorK26uDdhQB eBrio08K4XBQaJ6QwoZAdY5CqS6a3cdBkXElHTdokbIHhbeXmLx1r8GPRtK74bMWkOie blGvXbQ2wYgQS6qWSF2nMuelZ7tEG2E/wiqrQtiKFuV9atu6WQHL8+x/BJ/oyvHH7uF7 X2EZ8G6bTCQsPHYEWwJLnl/Hu2bnHr/wcLQHjhD3xYXKSEwT5S6RPN/jx2tONkgtD2Y9 rJVqUjEXgMqahIu8lTqBlzWbnWhKNcjQC0rjStdEJ0KYQMf4roYMLUOpbJ2TB6JKohiQ kspg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b="CdWBM/XV"; 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 t13-20020a170906178d00b0073094d10c95si1788309eje.706.2022.08.01.14.45.56; Mon, 01 Aug 2022 14:46:22 -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="CdWBM/XV"; 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 S234487AbiHAVXV (ORCPT + 99 others); Mon, 1 Aug 2022 17:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234383AbiHAVXH (ORCPT ); Mon, 1 Aug 2022 17:23:07 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5A6229809 for ; Mon, 1 Aug 2022 14:23:06 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso8021091wma.2 for ; Mon, 01 Aug 2022 14:23:06 -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=bjRNYXxMr1okCGj2grS3n0YP83rNlXVFleMjal7EwMQ=; b=CdWBM/XVBQnFOux95uKEi7bIQ7XVlE9NzZL0Q8RuNZTxHgYcVOCyBar98w2ZTfDTf3 v7HWPw8OmZjvGrBLM9osAKOnvX8/7+qfWrx9hPdzX6CTS5Nr3kMP4AYpnsrfCcoD1DAL 3pKyleSw2gm2CA+FTtPGX8TlanE2ftfdvjL1QXuoMwQlc6MkGI7jh7iwaQq3xUKw/5GP 4V6MU4m2tMrSq54i06/DnMPEe+H1SH1no3UP+Htuni1qp5GurOQTnO9rXKYtWlH2ewsT 1Q7o3pXrvA/9XhXR3UC7gSsDsz9ClawO4Cn7RCahtyDPs53Qp733bj2jJUpJyFxto9o1 Ojiw== 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=bjRNYXxMr1okCGj2grS3n0YP83rNlXVFleMjal7EwMQ=; b=fPyXyPxw4/FR7a4YT/MWe8WgkhEZclCGv7B8sfc0YdoSNERbKnGeroSof9YfR5N+Xm cFigoX9PKAUCOYLXpPec2yLTcJ26cMpuSkjzvwaTxGJeI6n7GdH/L5jGV253g6aEmY3j 2ZlB+EcGufaT/t0ctvz3upiYLryGgM9gTHWT6PV3TeaVY8B2He37HwyYGT2nS/pB14yZ AHVIShZXTN761VQfgZBh7KtZKDQS0d6qHyIae+vAnMHOF78aL/s7wruic/Jg7AAK54Sv aFHOpNiRSuXjXfdPl3jFS+0yqdE87nQtE+3trDLpRCWaEg9D4B3lAU7NyUrTLAPHv3tD KKlA== X-Gm-Message-State: AJIora/hdufR+OvhKkGRXgiJuBWvVLoE900CKwoVVGLjEFm/E/LlYENa jvd9IhdmIbaCudHloXqQrqF7FQ== X-Received: by 2002:a05:600c:35c6:b0:3a3:4217:f06e with SMTP id r6-20020a05600c35c600b003a34217f06emr11826987wmq.95.1659388986287; Mon, 01 Aug 2022 14:23:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:23:06 -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-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support) Subject: [PATCH v4 03/32] thermal/drivers/rockchip: Switch to new of API Date: Mon, 1 Aug 2022 23:22:15 +0200 Message-Id: <20220801212244.1124867-4-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=ham 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/rockchip_thermal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index dc3a9c276a09..819e059cde71 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1211,9 +1211,9 @@ static irqreturn_t rockchip_thermal_alarm_irq_thread(int irq, void *dev) return IRQ_HANDLED; } -static int rockchip_thermal_set_trips(void *_sensor, int low, int high) +static int rockchip_thermal_set_trips(struct thermal_zone_device *tz, int low, int high) { - struct rockchip_thermal_sensor *sensor = _sensor; + struct rockchip_thermal_sensor *sensor = tz->devdata; struct rockchip_thermal_data *thermal = sensor->thermal; const struct rockchip_tsadc_chip *tsadc = thermal->chip; @@ -1224,9 +1224,9 @@ static int rockchip_thermal_set_trips(void *_sensor, int low, int high) sensor->id, thermal->regs, high); } -static int rockchip_thermal_get_temp(void *_sensor, int *out_temp) +static int rockchip_thermal_get_temp(struct thermal_zone_device *tz, int *out_temp) { - struct rockchip_thermal_sensor *sensor = _sensor; + struct rockchip_thermal_sensor *sensor = tz->devdata; struct rockchip_thermal_data *thermal = sensor->thermal; const struct rockchip_tsadc_chip *tsadc = sensor->thermal->chip; int retval; @@ -1239,7 +1239,7 @@ static int rockchip_thermal_get_temp(void *_sensor, int *out_temp) return retval; } -static const struct thermal_zone_of_device_ops rockchip_of_thermal_ops = { +static const struct thermal_zone_device_ops rockchip_of_thermal_ops = { .get_temp = rockchip_thermal_get_temp, .set_trips = rockchip_thermal_set_trips, }; @@ -1326,8 +1326,8 @@ rockchip_thermal_register_sensor(struct platform_device *pdev, sensor->thermal = thermal; sensor->id = id; - sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id, - sensor, &rockchip_of_thermal_ops); + sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, id, sensor, + &rockchip_of_thermal_ops); if (IS_ERR(sensor->tzd)) { error = PTR_ERR(sensor->tzd); dev_err(&pdev->dev, "failed to register sensor %d: %d\n", -- 2.25.1