Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp223305imn; Mon, 25 Jul 2022 14:36:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6EVDpj7QCR7TsrZ/Qhwkw1XwLgx0hUd3CMFOEtAQYs2n11fXIgfkG+pLfahiGgtgR19GK X-Received: by 2002:a05:6a00:2193:b0:52b:f97b:ac6 with SMTP id h19-20020a056a00219300b0052bf97b0ac6mr6240253pfi.44.1658784993849; Mon, 25 Jul 2022 14:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658784993; cv=none; d=google.com; s=arc-20160816; b=AHRo51L4KfpsHZaqcGrXHapEfN1Ruze2EJOcTGRFSv2iy3yHn2Ulev0e5kRP2uEhZy PqZTFzFtSwBDpLGArUa8+mA5oFTHFChjwmcNdlAtDXo6wDgaZgvKQhkeiHmRPreNA7De AS8Rn8b1U0Vyh2+Ki+zKoByvUB38UKO8zOh4HiBuFXG2E/4qCahdWgOau3vUWtEyCDtf h+QoKXSi+ZDTrbZNW7dNJlzoq7QCM8KA2PKkH+09Kc/kUwiyYZzpNwVZw0uEKcsy2lSg +/5PKGKTuywK0taFpTpNRVJiUiddDmBHGY+wjwETCG6tWE2WB8X8dZa8aBH2k2ZZZ7gL QHXQ== 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=mgYfULpHDITp8sTJh4MUUpvj4JEzGZnhI8IhnDDJrPZ+vPX5H+5x1r4mUVTrlgkFK3 zaa8YcRqtb8Exr81Pu0sekZ7m0OVhvq3N+6/AYnBljYFm5Q3mEAMX8PJ/apJAykEcFT7 EnZpXXj1OdAnlDIZE8X2LN+NpxTKdlNXpPg/msF8qwnvoWoa54Gu2JVV7g704SjnIDNq /EP9Q/nDALQqo6TB4tFghlMbCvA0mRCxdoM3cuVYwirMNpgH5gRdzmxW4A3Qve7zJ0LH ZP8+vxQ1lnFPaDHY060bhPosN6/uzUfnWkxarAGsZt2zOcGZAiFg8tOw1L7S9RBaIuAV VX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=fpGNc8n1; 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 b33-20020a631b61000000b003db947d50fcsi15561294pgm.174.2022.07.25.14.36.19; Mon, 25 Jul 2022 14:36:33 -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=fpGNc8n1; 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 S237456AbiGYVbP (ORCPT + 99 others); Mon, 25 Jul 2022 17:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235512AbiGYV2s (ORCPT ); Mon, 25 Jul 2022 17:28:48 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3569C25296 for ; Mon, 25 Jul 2022 14:27:51 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id g2so9659817wru.3 for ; Mon, 25 Jul 2022 14:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linexp-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dtIC8RNPtrIhefVP3qkzn/ojto5ZENqxzOLIoU7Obsk=; b=fpGNc8n1xXJ0imA/RGA543TJhgsAaJo9AZK6Lbnx9rKmV/f4ipl9YuG4iyqU1Pn+HK DWc6xfs4lcvmwoejpmcgy2XzCrnJHfp6HwZ8Jiky/3RVh1f1l59Hd/amLfHg2Y9SfiTG 4x8uBz8cwG/3nLpf9sXeO+ZJmOBET2cLqsaRGNPOelXNBEQizf5w6T7qX8+skV1dvZQA sICPw4uNgIU0Nul5Pz25KafqkTB2Ta3xShV6Og2pH2/NK63YTo9ichfn6UBguYYRa5a5 5p3ujwgdzN0+e3NFNffrZxxCHrThrJCeLd6yOUGVsaZwsL0qtwaxwg6Gii+lwqemHQOk ib+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dtIC8RNPtrIhefVP3qkzn/ojto5ZENqxzOLIoU7Obsk=; b=iYKnynXRhJ/aAZJMgVQJv1sGi62FelnMHFUmQnCxqV1C7AlRvDpAPqlKR9KBek9W5s mu00SD8ETrnGaqV7+Aq7peZvgbCfiwlpTfNswRA5ZEK3ILuxtlMTJsMJEDoOnvoF9L5A nbaXTPEReTdEwSevi8oaqyi1rEj88Y9ZNRIHV44RKAgR44zUBDhlxyoVX6Ic3eTY0IIG x8CIszqJLeZ/r2bW8zlYRZ5DiI8kmEphgpk3xcRF2xTaKYf3LItLlivd9dk5OubYi/ez F3wkreG+e5nN9wE8Yvk6WBl6zouFlRsv4yuTANh5mwAcUHf2Ic6AAlPRE9fUb5Srq6ca fj1g== X-Gm-Message-State: AJIora9ligT9uanmyahx4udg9G/qdIWPYstkRVfSm7ncxT0RgCNCmCVi DvlBHHLoBhILWUMXn2hF8NHLDQ== X-Received: by 2002:adf:f245:0:b0:21d:a39a:bed5 with SMTP id b5-20020adff245000000b0021da39abed5mr8266370wrp.508.1658784470723; Mon, 25 Jul 2022 14:27:50 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:1780:8e54:dd38:6668]) by smtp.gmail.com with ESMTPSA id r17-20020a5d52d1000000b0021d68a504cbsm12668772wrv.94.2022.07.25.14.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27:50 -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 v2 23/32] thermal/drivers/hisilicon: Switch to new of API Date: Mon, 25 Jul 2022 23:26:28 +0200 Message-Id: <20220725212637.2818207-24-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220725212637.2818207-1-daniel.lezcano@linexp.org> References: <20220725212637.2818207-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