From patchwork Mon Aug 1 21:22:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 595216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65BA9C19F2C for ; Mon, 1 Aug 2022 21:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235356AbiHAV0r (ORCPT ); Mon, 1 Aug 2022 17:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235180AbiHAVZe (ORCPT ); Mon, 1 Aug 2022 17:25:34 -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 61F1A48E83 for ; Mon, 1 Aug 2022 14:24:14 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id z12so5505239wrs.9 for ; Mon, 01 Aug 2022 14:24:14 -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=kpAJvHnsGVgVYdV6CGwRXamKol+XLg/BJyowOdExSUs=; b=F9Rp5XIfTNsMRnVUYBaGtl9WsUFHBiNlkLG5UhGRqxRe0iTwGYk81ALUdZg+JpG/3G 85OitBnsTprwJCW8T0AS1CTGhKIGy+QfEXJSdHE0KZ6i3nyjb36u1nYai9GvGnW9X9O1 LAw+RZKjbidHFELCpadPbRpRY0/dJtc/UKPOhwWT8Cl9PHwn7UFL2AuWunjh3M5HiKtW wbIv6wjZ/U5AeLvlvK9ja8iH3Lz2xideY5d0taJEO4JLAORWwykIdxzfgn7j9JoGUEEn KrDGACM1Nl53w5ln23Vg97tgiiZClVdRTPD0uYjXnrehwshvrS/ZqHS/OMX5P9PfpGQz yeAA== 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=kpAJvHnsGVgVYdV6CGwRXamKol+XLg/BJyowOdExSUs=; b=Zodv8jIU8wSnci9Hmeji8eiYBEqAgX0+8nLH//1r+5FC6lNqV1Jyb6KMqPtkB38kAJ X1EUt+79+UjLJ+/1qiDJdZcd9g6tIKS3vUylgTSsulcGQjYfk2Nb0rnuyOQ4Lo41hZkv hkvurkvxbL3Z3SUw314fE58l7FIW4Mw3d8girHb3GblcnKPMtIzlhWUu5EmLkkLeN9Y3 cH4VBinUT9XpX+uo3Yo7p3Uebrtwz+yewLJ1iNimMEB1MpZ4xTIkkVUDxbI2uGF05AN3 z2gUWpHAoyLVWlxv5QkXI3SQzgXvKzoiMwRr41p7d0x7KsJeuESHGc2+I0ougYl3OPTa RFAg== X-Gm-Message-State: ACgBeo0baJ7gbK3fkdJ/idZrGo9+75Cp3Mvlv824Cy2Xz8LQZszAmFE8 Zv8MlSZkTQALx5M2q50IJe6Fvg== X-Google-Smtp-Source: AA6agR5cjynS7Tv4uPwkZ4YQew9ugTBY9m8nxDP2tIpAzTjc9/d3an3hkoOLOqz64Geqky9SMdLt1w== X-Received: by 2002:a5d:47c4:0:b0:21f:f34:56fd with SMTP id o4-20020a5d47c4000000b0021f0f3456fdmr10744222wrc.585.1659389052349; Mon, 01 Aug 2022 14:24:12 -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.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 14:24: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, Dmitry Torokhov , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-input@vger.kernel.org (open list:INPUT (KEYBOARD, MOUSE, JOYSTICK , TOUCHSCREEN)...), 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 28/32] Input: sun4i-ts - switch to new of thermal API Date: Mon, 1 Aug 2022 23:22:40 +0200 Message-Id: <20220801212244.1124867-29-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 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Acked-by: Dmitry Torokhov --- drivers/input/touchscreen/sun4i-ts.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c index 742a7e96c1b5..73eb8f80be6e 100644 --- a/drivers/input/touchscreen/sun4i-ts.c +++ b/drivers/input/touchscreen/sun4i-ts.c @@ -192,12 +192,12 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp) return 0; } -static int sun4i_get_tz_temp(void *data, int *temp) +static int sun4i_get_tz_temp(struct thermal_zone_device *tz, int *temp) { - return sun4i_get_temp(data, temp); + return sun4i_get_temp(tz->devdata, temp); } -static const struct thermal_zone_of_device_ops sun4i_ts_tz_ops = { +static const struct thermal_zone_device_ops sun4i_ts_tz_ops = { .get_temp = sun4i_get_tz_temp, }; @@ -356,8 +356,8 @@ static int sun4i_ts_probe(struct platform_device *pdev) if (IS_ERR(hwmon)) return PTR_ERR(hwmon); - thermal = devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, - &sun4i_ts_tz_ops); + thermal = devm_thermal_of_zone_register(ts->dev, 0, ts, + &sun4i_ts_tz_ops); if (IS_ERR(thermal)) return PTR_ERR(thermal);