Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp230752imn; Mon, 25 Jul 2022 14:50:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vyozLkJXqPBPOjlpA+MJdg8iXIkogakl5gwkYTHbAC5nkRCy5P+gv7bkuO+cflNhwyLfGD X-Received: by 2002:a17:902:f788:b0:16c:f48b:905e with SMTP id q8-20020a170902f78800b0016cf48b905emr14345566pln.60.1658785836941; Mon, 25 Jul 2022 14:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658785836; cv=none; d=google.com; s=arc-20160816; b=XA6tLtJwnZTp1YphFw68HcNEGmrWzcPC63MzH+r4nIrTKywJ1fPuQdaZ2TxuBw+ZD3 5zC2VJrocwXfjWwKIQvaavYNmdL/XrzBVuI666mpuUOyUF9KvmtD3HjdU+0Y5CdKfjwI PhqNRq7vJMJfWAQ+4QqqpGGX/ITN2NX9TuMED2twhlyND7TRBVxN4I9fXpqmPHmfSGeK fL61i8yksiQL+Ma4qZmtPm8B4Qpe6rkU7WN4wZedCN6TeAliJOy2EHw358iSvpORtbwn ldtgV+9LdUKT6Bfg5KkUhrU0HEE6vbOsH2pvixS7VEIxLld+Ic+AZGF++aLHpURNHiqu cYxA== 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=CsU6ca+7WX/xVGECcsjSjS8CnQ/NXZV7RYxDyAjfgbo=; b=wMReiBtLENJRIZMoF695HFBJP/2tSEsjakhTODCLcxMqbUOigaCWA7YNK+36BGcd7y 53KVezm4XqdPkXhNtFFmSN7KIobcDfoa7JEhmVGcUKTlTxkaCNge7EKwqYpjT+6l4wCE YMNgbdKyZ6hWk01ipwKHXB0xSeRTv9YGEaOBWmKMyBtn5l3+kWbwoqVJ7ItWbR58T3WN kuL0GYdRtlc0t/krjca441Moraei4MsjU1a8lR3dsRT9Y7r7SF+KrmEl1lOqX/Kzs02L 0iVv4Uo43ujqNRAeAJYWsHGQ3qcvGd9mD5eaJXwEvrsDJxb65MTnFEhXjCOdFxkrWd1H c6nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=tjmiNYVq; 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 b1-20020a170902d50100b0016d3454fcfdsi6686244plg.482.2022.07.25.14.50.22; Mon, 25 Jul 2022 14:50:36 -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=tjmiNYVq; 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 S232047AbiGYV3V (ORCPT + 99 others); Mon, 25 Jul 2022 17:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237397AbiGYV20 (ORCPT ); Mon, 25 Jul 2022 17:28:26 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4F9E24973 for ; Mon, 25 Jul 2022 14:27:45 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id h9so17756904wrm.0 for ; Mon, 25 Jul 2022 14:27:45 -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=CsU6ca+7WX/xVGECcsjSjS8CnQ/NXZV7RYxDyAjfgbo=; b=tjmiNYVqtsTChO02vhbkBNOAETx1giolsKbKa9UIaimnQiiS1T6pdHQp0b5G/IunYK xYlWtgk/sixvp/pvh3PSYS8QQDTV3rxGukQvo1qpLvjT6b/h2SXdvKOTlRIKn9RF/GQ8 lIRDVIO5fM64Dlk9BI3eBeyCvtIE37+5ozjxGRB/54yGknNnvclr/jdlBVkugB2xfw5u qq0oRa2ucA2+e9wifU4KUR3apoWjg4BcuV/GF437Rs7imkr+Fhl69Sdx41NbAf3LdBlk bZkmCwyY3L5Tgay0v5/P0MB+3iyDYpx9SXhXIqD7xRpzWAm+tF9fEnMP9dtYGVNp0MC+ iNQg== 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=CsU6ca+7WX/xVGECcsjSjS8CnQ/NXZV7RYxDyAjfgbo=; b=h1XkDH7yNMnkNmBVEXmJ6gSXS44WdqH6zeRwEnkqqdZ5q+VVIopzZa9632YKoc+CFe Wjjq0/mBPfYrnI91g+8lTOmZTNChZIU2LlbPFO/jg+eSfhRYcPIhrudugjbtCoe46ob6 A1XzivgblHd/aN29uB5CU2GbsuwQNw+MBCFzrtQR07K5A3yRDYZEix+eB5VX+nMQ/Omh bXCfW+sS3Q3hIKotiovkdx/OGGrLlZF++Heq77aGciC0P2msMzM14Nm5ua309hvyz0mU ixSRkCndbf0owwtfGsDsOMDd4QpGyNDT+SSZWWZGVmM7CBfxI5mdfC1BurKcy8MNV2Zi jUvQ== X-Gm-Message-State: AJIora8C0iw1TqdLvyeM4pKbycupKaF58Lc0KyslZmsekqaNlxmcHxPS ufnv5RG6Xzt8/cVZMlHFKXQMhw== X-Received: by 2002:adf:f747:0:b0:21e:8e2a:7cbc with SMTP id z7-20020adff747000000b0021e8e2a7cbcmr3190615wrp.342.1658784462157; Mon, 25 Jul 2022 14:27:42 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27:41 -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 19/32] thermal/drivers/qoriq: Switch to new of API Date: Mon, 25 Jul 2022 23:26:24 +0200 Message-Id: <20220725212637.2818207-20-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/qoriq_thermal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c index 73049f9bea25..d111e218f362 100644 --- a/drivers/thermal/qoriq_thermal.c +++ b/drivers/thermal/qoriq_thermal.c @@ -82,9 +82,9 @@ static struct qoriq_tmu_data *qoriq_sensor_to_data(struct qoriq_sensor *s) return container_of(s, struct qoriq_tmu_data, sensor[s->id]); } -static int tmu_get_temp(void *p, int *temp) +static int tmu_get_temp(struct thermal_zone_device *tz, int *temp) { - struct qoriq_sensor *qsensor = p; + struct qoriq_sensor *qsensor = tz->devdata; struct qoriq_tmu_data *qdata = qoriq_sensor_to_data(qsensor); u32 val; /* @@ -122,7 +122,7 @@ static int tmu_get_temp(void *p, int *temp) return 0; } -static const struct thermal_zone_of_device_ops tmu_tz_ops = { +static const struct thermal_zone_device_ops tmu_tz_ops = { .get_temp = tmu_get_temp, }; @@ -146,9 +146,9 @@ static int qoriq_tmu_register_tmu_zone(struct device *dev, sensor->id = id; - tzd = devm_thermal_zone_of_sensor_register(dev, id, - sensor, - &tmu_tz_ops); + tzd = devm_thermal_of_zone_register(dev, id, + sensor, + &tmu_tz_ops); ret = PTR_ERR_OR_ZERO(tzd); if (ret) { if (ret == -ENODEV) -- 2.25.1