Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1075772rwb; Thu, 4 Aug 2022 16:56:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR5x2wNQik42qalhn4sSLUS+cxFgfhq+hy5pJcfs0Lx5c9X5E665iXXH9R3S1S7+DrvpEAMB X-Received: by 2002:a17:907:c26:b0:72b:4d8e:b458 with SMTP id ga38-20020a1709070c2600b0072b4d8eb458mr3219382ejc.195.1659657402502; Thu, 04 Aug 2022 16:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659657402; cv=none; d=google.com; s=arc-20160816; b=UoJt9baBjugF07VWzM5k/XPZv8VWM3KRVqhcFn3zJagy4Sw9FC3csZgw+CcrMT8Kfo DhO+0Me/LfRMeqydKxNyHbPDUGYwYGGlQdRTvpp5m0N+51mz4Y7eT1bgcJ4+GklybMeB 9glIwFqyuzewHDsDltMF09JxL06Nru1jOEpSTGP2Yf1ao46BNkle9y2ctR0FgqZxRTGs bmPNGKscJ0ENMIDt6wPyfS9oqsJ8c9rJE5XkT+W8OFDce1+57DsHYRHu/AAMrdqDQtVl PwdN1RHyhZL4tE0axybvGz4eCfI0PBupRCMhzE1NzPM5gSgq0N6uq2bus/xFBq7mpoZq C/+g== 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=HTzCNvjUvskQrrwCTycgjHlvzzPpu7sdxXubhOMkEM33VVtto3ghzr4ABOpgsz2UtE VlwPbHjtmR6PpAfVpzApNH+eZ3scfelhOscO0pvjC8DD3yc2I10oPKD0MrDdRecSkl6w C6tEfKXH0CvMGLfA4MTHTRzXvFyVLqnPmaCTA+6aBlMcSD2BVbrPDk6p14bn33yYrpKn t+eg1i8TCLoxRctl9egCpfSkYvjgdk4Z+LHFQXDuoZ1zJQuTDKdDahMH8uZJgH8ea7o5 mMWWDFBQQ2FzJyBPb7VR/DmbulVVZNJwdjRYwBgCg8LiAYyFWYerPiGf2uWDKFLrgZH1 wRgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=vbw135Bz; 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 j12-20020a05640211cc00b0043dd8d7a33bsi3084890edw.24.2022.08.04.16.56.18; Thu, 04 Aug 2022 16:56:42 -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=vbw135Bz; 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 S240234AbiHDWwT (ORCPT + 99 others); Thu, 4 Aug 2022 18:52:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239651AbiHDWv7 (ORCPT ); Thu, 4 Aug 2022 18:51:59 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC6693E773 for ; Thu, 4 Aug 2022 15:51:58 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id v131-20020a1cac89000000b003a4bb3f786bso3187907wme.0 for ; Thu, 04 Aug 2022 15:51:58 -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=vbw135BzoF5BZ3lqxmC26ZTkmuAengG0jZ8dEp7H8cB9kuSJpS2x+dzQ2BkUsXXb3u imvV3FlLlFGpENNBGbg/GP3hIklTyCirTOP6FsbFzXEUsdU2wu3cxP5djpVBE0xBLD9h /qnekkn6WjyApUeOaREApf3bwGnrDgkJMpWM7Jsx7+Be3W9DFgxv7Eg2zz83iZU3gnNj y49S+b4oloRPYLpTiIZNgfAjSiyULwxb7WkQLQvb9i/DI1tY0YiJpJyL7OQ5sbfOAp3S Q+UYIgF/ZkN7RuaEBmjsUQj9xAtbiEtHMswYadwB65Xy7xRTgEViYevk77E4PiYyl+x7 3n4g== 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=5iBKPz9ioAtVxtmzrYBEs09QQbtU0L8Evu8G2VSodij8ABi6JJCX0i5s9opQ+Qw1rE ZttWN+zCb8yOEFWH0hCd282pcs90XX4s/pAouUuo1N5kaXyCHBcRSUBvX0o9YnoyBVoN BwdTiPRC5arIW3nmp3tcrVIHZlZyKWjVbUhE/0lGpsyZ3R6yxAP9l9F+dzBoDNOYC9pL gsWMdXsBreJtPnV54uVjr2yMTviAnSKsbHlx1a9trvVuA4CWn5ViElUzr5SU8XeouEa0 ayJU5TpXAWEDViQWBfEaEVNc/CDF96aK37P0+9lSq45Xk5UOGR7JTrY/J9kMYmDuwPZ3 BEBA== X-Gm-Message-State: ACgBeo0yMKJ/H7lh5EFx2NlwEPXcvXT/6jH4h9zOq1KU167p+OWlbz96 mfWIZH7AmxGXvJXI2YuAnrxQY9s+aaS5gw== X-Received: by 2002:a05:600c:2244:b0:3a5:1207:a1aa with SMTP id a4-20020a05600c224400b003a51207a1aamr2777096wmm.176.1659653517197; Thu, 04 Aug 2022 15:51:57 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:31aa:ed2c:3f7:19d]) by smtp.gmail.com with ESMTPSA id a16-20020a056000051000b0021f87e8945asm2495906wrf.12.2022.08.04.15.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:51:56 -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 v5 03/33] thermal/drivers/rockchip: Switch to new of API Date: Fri, 5 Aug 2022 00:43:19 +0200 Message-Id: <20220804224349.1926752-4-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220804224349.1926752-1-daniel.lezcano@linexp.org> References: <20220804224349.1926752-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