From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBEC04C61 for ; Mon, 25 Jul 2022 21:27:14 +0000 (UTC) Received: by mail-wr1-f42.google.com with SMTP id d13so10054991wrn.10 for ; Mon, 25 Jul 2022 14:27:14 -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=6+IbCbjvww7/6MCT8FlO/AyuSJ2MYApVBUJpYGG38Fs=; b=fSrO/7vc7YdETGnbNnO4MEoFJhS6dOOpUs+z5Z4Q0CqwrIfzxANf5LlJa+hCQ7v27l 81lRhs5MjQ0RwMyOU1vngZmBC0e5WlCSypRzTh/imp8F2C1+GGzPkieklV32eFN2eqX9 2b3oxol1P3daqJxMXwf4AxNNCTUB+WzRIBt9g92q7jF/q5+OucyDzf9mbEvrFMBaGxfz CqAZFsBA51J9kXHUQafWLlFPmTmqUcZtH2Cdfe9nYyZJBzW5lG4pms2f0xN0wPiv5EE6 Ygn629fB7mPhzemvLau3tiqVBuPXCBBLBoh7CbwaV3G6d1ARVwrhfAc0OnXBq+JjYc7r uYRw== 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=6+IbCbjvww7/6MCT8FlO/AyuSJ2MYApVBUJpYGG38Fs=; b=Cko5hikNf/1Hvo60Nw5WkfRi3JcfISzl2ajeRhY01eQbn+3r13XiyCDqUr9kPLzzg8 VhuatD5C1BcQSv1xjw5c7y5qOpKvFr/RUuvIbQ3RIB8UKzTsTx3KpW5nqi8XCBrJIB3n WtXxWSLkUoDzBVpBoZBya5yM6MC2mtSFSbTN8x1YfLQSOvYJyBvdgdJ4ElkGdismLJmT Xp0bvyI9/S1O6NX85Q5NLmROZ30AxB+FlIsqZj3BZse3awdJMjYa8N/kZPsGU9cTHTk7 UMma3JKPTO5S5LJmhbL5Ryljv+hHSu3mUY78JqGiNw9Az6r/jXfgIiVm5QoVHyp5MbBq FHPg== X-Gm-Message-State: AJIora92qo9sUD3C7xZtUtKRjp0OIzmLeA3grBFfjbr/EIefWMxdEpB5 N3rE29f6lVjEw98jKSxUzhXDzw== X-Google-Smtp-Source: AGRyM1tPhZQxz2m/hgQzzipXQqvcy35d3jJ4+m1gu6vcvitjtr9rcjLcXjbfXhHboUlBS2gK8XX4ow== X-Received: by 2002:adf:f245:0:b0:21d:a39a:bed5 with SMTP id b5-20020adff245000000b0021da39abed5mr8265442wrp.508.1658784433206; Mon, 25 Jul 2022 14:27:13 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27: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 v2 08/32] thermal/drivers/sun8i: Switch to new of API Date: Mon, 25 Jul 2022 23:26:13 +0200 Message-Id: <20220725212637.2818207-9-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> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 d9cd23cbb671..2a4fa4068950 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