From patchwork Mon Jul 25 21:26:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 593992 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 1A8F9C43334 for ; Mon, 25 Jul 2022 21:31:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237340AbiGYVbK (ORCPT ); Mon, 25 Jul 2022 17:31:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237215AbiGYV2o (ORCPT ); Mon, 25 Jul 2022 17:28:44 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B89625295 for ; Mon, 25 Jul 2022 14:27:51 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id id17so7632023wmb.1 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=5vPTvuI94uga8nmWiqOTMlhssMKMlt7Rbmmokv8UyAg=; b=b2VZ8Ju8IwtY6a6J6GJwWN+9At19kwozRPe13f2CTVnLgb2W4A989u3Y0aiRzpqCeF 1J0NpYYL7WbpTE0kPHlR1AELCW/7ceZKgc7wyI5T6s/3pmekxppjBcqa8SdH4V9A8Yr0 DWNNEM8c1OTx+dCyNJBHhk6uWGwbS8p1ApOslg3Pand4UdhH18E1sQMHy7wO1L27Em8L ndaCXDKohkiM2dwvJtx369LeryzzZKJ9E5ee1pYKZM7N62r+g6GaJAI+tZLe93ERpB5J OTWGCj47lzDyNfimDx+AEN0VSLghbaJsbdWVWo2dKQM39c5o0XYWZKCTLHe0xaEv7hmP zk/g== 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=5vPTvuI94uga8nmWiqOTMlhssMKMlt7Rbmmokv8UyAg=; b=yMkdiTEhjnjRGHYHqvzbN67W0OBcSI4dc69quzmWG1jyF+/NKmx+c7xnHHBZECFtVc 6Hh6G8Glw8dbFVhQ+QgHCRQOfXls4ALilcnyFLft1aBWHa7U1Nx3QuchYxWegQyIGZyZ T7trjjMh2wrWrOrAjIH7SVoorN+E4Xbih21vScUSNMpIgZNOSPuYFRei1R/pagScSnco Mf1DuO3/PzR3toVoLjDr0A0Li0gH16B8Mw6LSqDVHcOZfvR2uC2jo+iZ6bvkzIm/rqdL dR5SffjVAjViyOSRArk9XubEoWlm6qFVbDtmrWw7jWnMecz7uzIE+xL7azcRM4PKt8Xf YhDg== X-Gm-Message-State: AJIora9qViNt5uUobnOrAS74Oh5xHxIYzdsNQnnR/nNRbzRHvDmZHqBA nBo+HrZNj97uuJ5x+ltyyy7LjA== X-Google-Smtp-Source: AGRyM1tBn+lVCslS7l3C/D2sAss3SonsfMDvDGzZGhRSizto3CJv3y8B58GZuJKhGdD8qSOwrYh+IQ== X-Received: by 2002:a1c:4c0f:0:b0:3a3:1401:7660 with SMTP id z15-20020a1c4c0f000000b003a314017660mr22597468wmf.8.1658784468598; Mon, 25 Jul 2022 14:27:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27:48 -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 22/32] thermal/drivers/maxim: Switch to new of API Date: Mon, 25 Jul 2022 23:26:27 +0200 Message-Id: <20220725212637.2818207-23-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 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 --- drivers/thermal/max77620_thermal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/max77620_thermal.c b/drivers/thermal/max77620_thermal.c index 82d06c7411eb..6451a55eb582 100644 --- a/drivers/thermal/max77620_thermal.c +++ b/drivers/thermal/max77620_thermal.c @@ -44,9 +44,9 @@ struct max77620_therm_info { * Return 0 on success otherwise error number to show reason of failure. */ -static int max77620_thermal_read_temp(void *data, int *temp) +static int max77620_thermal_read_temp(struct thermal_zone_device *tz, int *temp) { - struct max77620_therm_info *mtherm = data; + struct max77620_therm_info *mtherm = tz->devdata; unsigned int val; int ret; @@ -66,7 +66,7 @@ static int max77620_thermal_read_temp(void *data, int *temp) return 0; } -static const struct thermal_zone_of_device_ops max77620_thermal_ops = { +static const struct thermal_zone_device_ops max77620_thermal_ops = { .get_temp = max77620_thermal_read_temp, }; @@ -114,7 +114,7 @@ static int max77620_thermal_probe(struct platform_device *pdev) */ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); - mtherm->tz_device = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, + mtherm->tz_device = devm_thermal_of_zone_register(&pdev->dev, 0, mtherm, &max77620_thermal_ops); if (IS_ERR(mtherm->tz_device)) { ret = PTR_ERR(mtherm->tz_device);