Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1052214rwb; Thu, 4 Aug 2022 16:23:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6hTskj436Q9aD0C/GHlFLrKn32PnQ6k88UjC8tBhfikVluZGJL+WsLAz19dSc8ccaQE9hz X-Received: by 2002:a63:2a89:0:b0:412:4d97:c687 with SMTP id q131-20020a632a89000000b004124d97c687mr3465976pgq.575.1659655414856; Thu, 04 Aug 2022 16:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659655414; cv=none; d=google.com; s=arc-20160816; b=fWsvc/Lw+4j/Azf452XZzU54n3RK9B96LViQkd6+K4KBx/xtKrvquG1bMMhOE7K3kp F4N12gDsUmQbuQenpovN22MBm8ay2tHtM7TUGBSUnImzp6b/78byOP2Z7ej78z2ccqjY 3igoUd85iAWl722wy+mFIpCAcYaaTJzcsvV6AdtIGhzy4U677DLKuXEsP6zl2lWlG+kn ce7baxpz862vDFDhS3Fn29ZVvWkGofo2vvjdsb8h9xwlnhC+fieolfpcNN0LPi/qi0lI rnoCWb9b9LfdimnfwHx6kkh50DmZZMJBEY3Goua18SVu3O1/4LhpeoPBstU3Sa37obJ7 lLjQ== 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=dtIC8RNPtrIhefVP3qkzn/ojto5ZENqxzOLIoU7Obsk=; b=tLVvpa27481yNL7SsurC5/trD6DlsA8jvnuH0IW9cUd+V1vz8mGCvLt4IZna/j/ct4 gQK9t1id+Xftm7srFe4rRtQe99siC/qWXZ/k4IijPiH4l5eMMrunKg36jUDiYLUwyQck FXj4oxZ8C+NZtSo+pREJbWUiSABDWrwCVtFFe9xUJQQynRaDoxhEDa4UFDwqZs6UMgHt 7Gr6PCt0v68vFIf7Eano6yhae7UQc81iPVfAFCXM8h5fBMe8lFO5uyJJzj9kBirHQmgY +ZzgrNl9rf+ztVtZ3YIfCLtEbFsnbf9FI1rc6E1ScAv84+KJHdbW6dRPgR/ziwI6YeA3 OxWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=ONlXQ4Nq; 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 d4-20020a170902cec400b0016d86335ae6si2779932plg.164.2022.08.04.16.23.20; Thu, 04 Aug 2022 16:23:34 -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=ONlXQ4Nq; 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 S230266AbiHDWym (ORCPT + 99 others); Thu, 4 Aug 2022 18:54:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240184AbiHDWxm (ORCPT ); Thu, 4 Aug 2022 18:53:42 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB2427434C for ; Thu, 4 Aug 2022 15:52:51 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id z16so1308719wrh.12 for ; Thu, 04 Aug 2022 15:52:51 -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=dtIC8RNPtrIhefVP3qkzn/ojto5ZENqxzOLIoU7Obsk=; b=ONlXQ4NqB3vgSX4uSliFdY3yNlFX4bZpvvDzZwFlFyr3ZLlO88lqPwrXqS55YesZ8e DTNI6aZvNZa2na35TxUOXs3x3d49FOgnNOoYfs/vJILt0dYPqOf4ABwjmHtSgR0D7FpC WycjoVoygBDjT52fGODVRcdVJzy1YQ2V+Nw8Rqa7NIEoqq4gXVPLR9RRsV/3+vhGBTqd L3IJqGo6PjzX0ddEmVsYl0sWpZXATF6aXd6drTHsACjXMHaaJB/jNfq2YQin+4IhhxBb +GqCpqocpp7NCuRG/ZvpnxDqD0gJM3/uSpyXLNj3Sp4cJRsENgfSb2c5USnGVYkeXte+ MH3g== 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=dtIC8RNPtrIhefVP3qkzn/ojto5ZENqxzOLIoU7Obsk=; b=QT/bGFQKbt+rHuDfF5rcHSrP8u64+uiCYZ1vZUez9Tq4m2ewd/NofivWblKVXYzlxU 3AAU8tHz+I+wmb0Y0Pu1hJ8PoPWHgF+JxqxPqH7LaXYM9rdU6D6/f+MBljt0EPkm1Pjn yJXQ0MgBcoe67qwUojhx0hlyiyY4G4M0DGnChRqerxoRuPmzqO4kbMTwmZTydCAVjzNq PZSr/eKPgLr/Owvy0Y7Vonxrzf91bQg8HGQYJdt+Y0UUS2nqZsCkPMrubovRRqv3O3Jl iObZW0+nDMJ45X6q8LabaPX89/UoaM0ZfO+Z3yrC+orNX5FMaZWb+56cn0vXsE6nVHv0 ayvA== X-Gm-Message-State: ACgBeo04lGnT69Uh2T4skHwZfZ9eNyY6JnULJVpdKY7Vh4jN2ib/U7gl muWCpp4cFAcA5ehDeNkbp9D5MA== X-Received: by 2002:a5d:64e2:0:b0:220:7dfb:ab6f with SMTP id g2-20020a5d64e2000000b002207dfbab6fmr2549880wri.664.1659653570191; Thu, 04 Aug 2022 15:52:50 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Aug 2022 15:52:49 -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 Subject: [PATCH v5 23/33] thermal/drivers/hisilicon: Switch to new of API Date: Fri, 5 Aug 2022 00:43:39 +0200 Message-Id: <20220804224349.1926752-24-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/hisi_thermal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index b29ab09040d5..cc5da71b6f55 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -442,9 +442,9 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data) return 0; } -static int hisi_thermal_get_temp(void *__data, int *temp) +static int hisi_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct hisi_thermal_sensor *sensor = __data; + struct hisi_thermal_sensor *sensor = tz->devdata; struct hisi_thermal_data *data = sensor->data; *temp = data->ops->get_temp(sensor); @@ -455,7 +455,7 @@ static int hisi_thermal_get_temp(void *__data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops hisi_of_thermal_ops = { +static const struct thermal_zone_device_ops hisi_of_thermal_ops = { .get_temp = hisi_thermal_get_temp, }; @@ -467,7 +467,7 @@ static irqreturn_t hisi_thermal_alarm_irq_thread(int irq, void *dev) data->ops->irq_handler(sensor); - hisi_thermal_get_temp(sensor, &temp); + temp = data->ops->get_temp(sensor); if (temp >= sensor->thres_temp) { dev_crit(&data->pdev->dev, @@ -492,9 +492,9 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev, int ret, i; const struct thermal_trip *trip; - sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, - sensor->id, sensor, - &hisi_of_thermal_ops); + sensor->tzd = devm_thermal_of_zone_register(&pdev->dev, + sensor->id, sensor, + &hisi_of_thermal_ops); if (IS_ERR(sensor->tzd)) { ret = PTR_ERR(sensor->tzd); sensor->tzd = NULL; -- 2.25.1