Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1045770rwb; Thu, 4 Aug 2022 16:15:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5To384064DkU9rkf/s5grAKE+BdtVoFzLFxLjSg3uedDhl0TT4R/9k/suqwJzye6Q/FYts X-Received: by 2002:a17:902:f609:b0:168:dcbe:7c4d with SMTP id n9-20020a170902f60900b00168dcbe7c4dmr3848165plg.169.1659654944219; Thu, 04 Aug 2022 16:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659654944; cv=none; d=google.com; s=arc-20160816; b=fH6v9TUnjeM4/wv0zxXp6kvwi9X0ygqm9XjJohKUFi+91l/r1TNJcxDoww7GTlvP8W AjE8DDw07WsHMG6iRY/C6Bqq4yCi3QeEkNAavYFQzcIkXaDL0bZcK056fjiIA4b/YchB gErCzTNlFa1i4eMHdsyIJb/w4QIuBq9mxS5Okk0AtfIw0JOVMQ6akeXOsOw7SyC6of3t jmQtBqnSeaSeD9mqafzKBo9CYARVk6DHYHHqo5sml7O/lWZDbIse9jnOY3v3cs3vWEby mN+hvYDqlM/zbD/GFPA4IFtMOHKl2YVPHZ/SNPufDt+BMNfS6rctys/tQa5DlkWH8RYt urKA== 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=KoCo3jVOreA60M5B2h+gu+yJSl6IxRYoUlnzq7WRBI0=; b=CyCY+qqzWXbEDeqnE6pBMhD+95xHh02wNcfbb0vPbNNbbQuswXFRS6bLRL/AxH3tY9 6NepNdn8pVegUf9BtkPdlVmiJmTTd7rhd0tzEbd/LIhCFyMTQW77czAKP79C7XKWq4qo sA97Idt9Dq3vtFIOjAQjDMeSyoiYDdKIB7BykSzMyAO3CEr0RLmiTaBUpwjPAywbzbrD pJMpKQJJDyTfWLwIqND1kc/tStygwBuSEpzG04RXoSVUHlldZByxigbvCoJqKAAA1CMf 8jSgNbXhND2CKG0rWEvnvkKMAGMGK4SkvP8NqPdeyUC+FW3YHeQ+jHij4xQ24lsAomXR +j2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=tK8BZUrY; 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 n4-20020a1709026a8400b0016c0ad2bff3si2016895plk.451.2022.08.04.16.15.30; Thu, 04 Aug 2022 16:15:44 -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=tK8BZUrY; 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 S240398AbiHDWwp (ORCPT + 99 others); Thu, 4 Aug 2022 18:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240229AbiHDWwQ (ORCPT ); Thu, 4 Aug 2022 18:52:16 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 606396FA07 for ; Thu, 4 Aug 2022 15:52:13 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id l4so1307339wrm.13 for ; Thu, 04 Aug 2022 15:52:13 -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=KoCo3jVOreA60M5B2h+gu+yJSl6IxRYoUlnzq7WRBI0=; b=tK8BZUrYjVSQkECpXaiG1qT4bYmfWcZCkyTFwzwm2zJsiqOs2137daSTFMuKmG6ZWf 6uxkl6beWGwhQZETcttDQAPtqpYYgBIkCsMTq+ac+SYyQFmkkzYYfgb7SPtRylhlT1MY hbSCVHmggrCRjLOEhccrCXswC8ML7Siwn7aI4rS4H4ZnDUU8pSwx+gPcUPFvtZQfqB6u /1CoVD3XIICZRz210i7lsScpbpQguQur0gISJO46OEXFjAtdMr5Jk7IBpqGU7KDXVn6G dObIG9YBDlYlvqHkRfawbEOcWbsiYobcEwnVQ1+hckMOCfjwPnrwFE8aqdcCAXFWBm3d QgSw== 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=KoCo3jVOreA60M5B2h+gu+yJSl6IxRYoUlnzq7WRBI0=; b=RUQ/4Z93sye7Qd7hgTzaVOCnxE31SkHfqb0zVI1MqPuCo6pFXaLTpBp0mqbcVB2SgG YHAn7hhQE+E9SEdPVm8eTOQdZCbJWMAvN/Qi89yDwLTWNvD07Bj4bh97M7aQTwqdX0yq 8rNKRzjUAyWfzqtU1wJBiZR669x7hWsZ5+a5uEy4mYL3HgwFqmElIZgO6CcV/qLLlNI5 Oe/AwU5OCyi6j3Qni7XBor/zO9WTQ6fWsaiW2WskdesnaSHz27JRm9DYEOwF0zp2QRcd caSoBRvTD2NdIKr/1KnCWC0cjEZDn+1SQOBe13RU3zCNNMStolvFYTp/kYXpTKtR0pq9 d0Iw== X-Gm-Message-State: ACgBeo0rAEU679yxQD01rrMpo/5kZglVAYZJyzf8qtzL96nKxWfyCgxH ZYIxH3BAWP+zUBBvOj8SXUDnwQ== X-Received: by 2002:a5d:5957:0:b0:220:79d5:f8ae with SMTP id e23-20020a5d5957000000b0022079d5f8aemr2588998wri.160.1659653532830; Thu, 04 Aug 2022 15:52:12 -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.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:52:12 -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 , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-sunxi@lists.linux.dev (open list:ARM/Allwinner sunXi SoC support) Subject: [PATCH v5 08/33] thermal/drivers/sun8i: Switch to new of API Date: Fri, 5 Aug 2022 00:43:24 +0200 Message-Id: <20220804224349.1926752-9-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/sun8i_thermal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index 212c87e63a66..e64d06d1328c 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -108,9 +108,9 @@ static int sun50i_h5_calc_temp(struct ths_device *tmdev, return -1590 * reg / 10 + 276000; } -static int sun8i_ths_get_temp(void *data, int *temp) +static int sun8i_ths_get_temp(struct thermal_zone_device *tz, int *temp) { - struct tsensor *s = data; + struct tsensor *s = tz->devdata; struct ths_device *tmdev = s->tmdev; int val = 0; @@ -135,7 +135,7 @@ static int sun8i_ths_get_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops ths_ops = { +static const struct thermal_zone_device_ops ths_ops = { .get_temp = sun8i_ths_get_temp, }; @@ -468,10 +468,10 @@ static int sun8i_ths_register(struct ths_device *tmdev) tmdev->sensor[i].tmdev = tmdev; tmdev->sensor[i].id = i; tmdev->sensor[i].tzd = - devm_thermal_zone_of_sensor_register(tmdev->dev, - i, - &tmdev->sensor[i], - &ths_ops); + devm_thermal_of_zone_register(tmdev->dev, + i, + &tmdev->sensor[i], + &ths_ops); if (IS_ERR(tmdev->sensor[i].tzd)) return PTR_ERR(tmdev->sensor[i].tzd); -- 2.25.1