Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2191153imn; Mon, 1 Aug 2022 14:46:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mU+WFQX6YteWF89MdE2q7g4V8WBfxw/t0AU946muI+zHDG5KH2wxLx/e2XKj+ybFu3I+F X-Received: by 2002:a17:90b:1a81:b0:1f4:f9ff:9028 with SMTP id ng1-20020a17090b1a8100b001f4f9ff9028mr8692216pjb.44.1659390365986; Mon, 01 Aug 2022 14:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659390365; cv=none; d=google.com; s=arc-20160816; b=dF/A3vI0CQMBvF5xXKuzu3Hq1GgH7aNV4rfppABxVVqTGIv50KWgZzvbRKIeopUNPu KEl8d8rkFUp4mIt3Q9Z48xcbykT1WRAQae2dmosbS2t1pH2jHLW2+PkJHvY2E+yP7HrA 9dUTa0I2zcZ/xOAUCHYjMC7lh2sRxpFFFmYhjFRhHdGzbkaK3rfSG2RAklNbLZ+01qMZ lwCJCiXFNeE6pn93J60QhhYVcyHk/LMvC0h6RUe+sn4N5ihlud5n9q6Jv5XB81WeuKL/ Xi3vR2BUiIye4hD71rVySKS6bn6Lr0Tre4V9TriwZqNImWdI38TaEY6GsOunHD4WxPcG w+2Q== 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=0/Dz3DthR5pOVt2/DWyN2qiy/lYltxiPjmUU+2JtzQbAVdy84CarqBZxsgRJVzHQQj Eaj4ZeJdRZJGNWL7HuP2tSgrH7NYleupHPAw0XMQYxR2x2mvtzmNSLZ/aEBx3NqT69OT ljH1bg7BoskV5sdT5tBsPbl8X7Yek99poG1KaSD7Tj1MMhJWwO0Qxv71yO9HCWZG6VC3 xryPM66C2K95cDNH88csi7ZvPPzZM2i6d4HeAvvAOA2kEzuvBJr295me94Ig6033nZUX H+5J5izXc9x8emvMJQVWpRoCtmDRPS0hAzbwT7F5cNoBRKxH0r3rLia83Q1DtH/JfEYt RCNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=cDdZ1fw1; 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 o5-20020a63fb05000000b00419fc0f56a3si12436447pgh.89.2022.08.01.14.45.51; Mon, 01 Aug 2022 14:46:05 -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=cDdZ1fw1; 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 S234388AbiHAVYA (ORCPT + 99 others); Mon, 1 Aug 2022 17:24:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234799AbiHAVXo (ORCPT ); Mon, 1 Aug 2022 17:23:44 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917D645F63 for ; Mon, 1 Aug 2022 14:23:23 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id u14-20020a05600c00ce00b003a323062569so6127681wmm.4 for ; Mon, 01 Aug 2022 14:23:23 -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=cDdZ1fw1VBXgwqqqsZJVe+iYyRklKK14Nx/crmCVIHw8nTjAmdzHAZrEMEIsHDSVaP bFwIIFVAGKzXoZu0VCb23bBjMJm/CUlPPCOnYKS+UGzltYOqJC69/9LrG/JUVnN093wV 2slfXYfe4ct/rYqRfPjhBmRIX1SLdZaggvEumZIoB27zW548fVkCmpjSQTG+gFfvjvKZ QvKhvR9ltxkSwsJx/nYTJohoJSSn5CWwYskzduELDEk8LrNDOeuqaIs4cJ/Zr+idIUZA PNMxm2osYyDFLMpC+JUb0Sp09O4220nLucKU4j1gBK4e8Xk9KtIrUkocoCKqzkAA+0Zx N5Sw== 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=yNI89QUNKVdzeKxa0635oU8kx89KZKeZHLaj4ftytnFwybV6USoaQyBDUhRsJx+HAI bAntoTWqAjEMvwm8uikAoLmmnFIdbHQgwCWvGkMAslB4f9ukchA8NxGvnElWG7HscRhV MhoFrpGyCdErmWxTqiqpQk11d75EXhcCztaNHccb1qttVZuHVwWZvE0TkKdDKgdgT745 vwsJiR96znM1K+iq6BOeqGtRM7HYjoyS0vCkN+yv7GrCgXjtQgpyiTWe9PSAzhxOXRC7 mTT9nqxe/LPrEZCoHUJpZAKGmu4g0BZWeNm5O0lFfyO08orrycsOBMlIitoCtXr+09MS oY5A== X-Gm-Message-State: AJIora/V3PSeRAPRWFf15IhqO0vMHNxDsp1L0W43ODUkQYsbNvoPFpfW fQ133hA6XpIwAVIquVopSTJChg== X-Received: by 2002:a1c:720a:0:b0:3a3:327:da23 with SMTP id n10-20020a1c720a000000b003a30327da23mr12932289wmc.196.1659389001926; Mon, 01 Aug 2022 14:23:21 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:23:21 -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 v4 08/32] thermal/drivers/sun8i: Switch to new of API Date: Mon, 1 Aug 2022 23:22:20 +0200 Message-Id: <20220801212244.1124867-9-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 --- 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