Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp220850imn; Mon, 25 Jul 2022 14:32:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tESFJYwJer9kdNMCJsmIscEfFk4s88bfyqp+bf0ENwhlAPnKl1vU460oFBrfZ7VkPDlHum X-Received: by 2002:a17:90b:1e4f:b0:1f2:b482:bab9 with SMTP id pi15-20020a17090b1e4f00b001f2b482bab9mr7756278pjb.9.1658784729972; Mon, 25 Jul 2022 14:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658784729; cv=none; d=google.com; s=arc-20160816; b=U7ZcF7TQ2ec4hwZvTs0AL5uHcHBQplxkTEXZQxdWUHR03Pv8UWmGgTjJ6VZEgGKE8P QcZaeRjAwU5IRmS+xcf47abfBlzm8lb7PVEUxWqt1M8B9JC77PDGCce/V5ml2LkSq6gY 8HjKlSh4i45tH7GoMcSPzcdxvriLKLou86LOd5Uoefm6auLv7ktrXg/ptmS7Kf0qRJD+ ulUqIqSGbFkrikkZ2puBYRKI9K6OjzZd+1Cv/6KVCecUprCazjTL/GC2gSU8e1zcTI3v PNPbD3WI7PVvifXyMLJN81hUStUaLFwbaz32O3j2F5G5Hs5+dO1Nku01THXTno9pM2oe KUqA== 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=WcT26bxdghVckoFOQydcurz7wa7nyvcLqA4Sho5B2kU=; b=nq5i/wSHhCf0Ga6ekyavPc/l01FtfHdeI49EFUKNdhmb7hTJq0VdqRSgYa9Diobz70 eyhOizqeymWYH6uM7LMdRHW6l1m8Fh/NdnIABc6Mbo0qTw7mKfBffovP2YeASe3VA3cM g3GmPHr6OgIvO+JcetXT+r2sHVGzPaELEYq8BMSdZq+oEVZ5EWgxvqeL7OeFaasI5mAz wAFRfDVVpJloa9IUYkX8kVuJvyT1j9o/dp8l1UeW5iepzWmMggCXQ/EOgvTLcDsnULj8 JmEJwWspwqwhf4pmvs7ZltY/PTF69OMePlK0PzKVFy+jbiehLMX1nZqE3yLXMMiMmSft 01qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=UnTy2ZqQ; 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 e5-20020a636905000000b0041a8f889a04si13353740pgc.803.2022.07.25.14.31.55; Mon, 25 Jul 2022 14:32:09 -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=UnTy2ZqQ; 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 S236745AbiGYV3f (ORCPT + 99 others); Mon, 25 Jul 2022 17:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236822AbiGYV2m (ORCPT ); Mon, 25 Jul 2022 17:28:42 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 668E424BCF for ; Mon, 25 Jul 2022 14:27:48 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id v67-20020a1cac46000000b003a1888b9d36so10218900wme.0 for ; Mon, 25 Jul 2022 14:27:48 -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=WcT26bxdghVckoFOQydcurz7wa7nyvcLqA4Sho5B2kU=; b=UnTy2ZqQ54nkBEnZa4nFUdJocliUWkBqUlDnt9qVb6o3YPfRiTMHb+MgP/nV0mQXyt rIkK02FnPj1VlMbJVqtfPeSgvt9dPSuhwclqlGO7F1UnXE5ODJZCOy4oodvNR+07j6wV 32oNuB0OQHApiKdag892W8xdHQslcluY5NC/cjAFLBlenRFygcqIyjDOOh/QXOqCVT/X 68SbYRs4nvupamaL4cGLWCg3HdzyXhsycsKHg8oZTsqsC5fluUWzP/0GSkRocb6cA7Rm +mdi/pNTxQPCTtYaFAwioloPK1X1vGUX8vY4Udc13r//1kH/atQlPRMVmMKYT+JYbfq/ Z4hg== 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=WcT26bxdghVckoFOQydcurz7wa7nyvcLqA4Sho5B2kU=; b=pZgUNR8pwSomS+JNzlhbNB3sDux+eOY8bwpbNeI3JV6jvND1eb123m5BievFN09Z+r O4CuvX3ZHZGexzpJz11+RvDBApxghTmAZ6U/WWCdqzih3jgTFn0vebPhWa12meb0WuyG XqAmjSSy+MyPNeHHINEu7eqVp2XVPMO2FZ7IoImRLlhJPdMTtWkOlTU2CFUiD/gB1jiu 20v0ym4a8Mn5PYXqYwu+JNyZxwzaMUIws/9Et6anfmlHxWWDiCkTFd6SRczAdrFnv+Os +GxQAMFMP67bQm5S4TVIxaK39OvD4zd9/BXQ9/TGsqxT/ZMZ5Sg8nBtFNIn6IQj7JmxH 7cWQ== X-Gm-Message-State: AJIora/d1MGUQPEam+7Hif/OIgA3qdWTcgZTZRN/dt9Kmbo6Cuu4Z0EQ WUeB3WbBeMIEkFhFLhgUpc6k4A== X-Received: by 2002:a05:600c:34c2:b0:3a3:62d3:de5 with SMTP id d2-20020a05600c34c200b003a362d30de5mr3737807wmq.29.1658784466492; Mon, 25 Jul 2022 14:27:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 14:27:46 -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 21/32] thermal/drivers/banggap: Switch to new of API Date: Mon, 25 Jul 2022 23:26:26 +0200 Message-Id: <20220725212637.2818207-22-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=unavailable 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/k3_bandgap.c | 12 ++++++------ drivers/thermal/k3_j72xx_bandgap.c | 12 +++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c index 5d0b3ffc6f46..22c9bcb899c3 100644 --- a/drivers/thermal/k3_bandgap.c +++ b/drivers/thermal/k3_bandgap.c @@ -139,9 +139,9 @@ static int k3_bgp_read_temp(struct k3_thermal_data *devdata, return 0; } -static int k3_thermal_get_temp(void *devdata, int *temp) +static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct k3_thermal_data *data = devdata; + struct k3_thermal_data *data = tz->devdata; int ret = 0; ret = k3_bgp_read_temp(data, temp); @@ -151,7 +151,7 @@ static int k3_thermal_get_temp(void *devdata, int *temp) return ret; } -static const struct thermal_zone_of_device_ops k3_of_thermal_ops = { +static const struct thermal_zone_device_ops k3_of_thermal_ops = { .get_temp = k3_thermal_get_temp, }; @@ -213,9 +213,9 @@ static int k3_bandgap_probe(struct platform_device *pdev) writel(val, data[id].bgp->base + data[id].ctrl_offset); data[id].tzd = - devm_thermal_zone_of_sensor_register(dev, id, - &data[id], - &k3_of_thermal_ops); + devm_thermal_of_zone_register(dev, id, + &data[id], + &k3_of_thermal_ops); if (IS_ERR(data[id].tzd)) { dev_err(dev, "thermal zone device is NULL\n"); ret = PTR_ERR(data[id].tzd); diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c index 64e323158952..38362d3aea99 100644 --- a/drivers/thermal/k3_j72xx_bandgap.c +++ b/drivers/thermal/k3_j72xx_bandgap.c @@ -249,9 +249,9 @@ static inline int k3_bgp_read_temp(struct k3_thermal_data *devdata, } /* Get temperature callback function for thermal zone */ -static int k3_thermal_get_temp(void *devdata, int *temp) +static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { - struct k3_thermal_data *data = devdata; + struct k3_thermal_data *data = tz->devdata; int ret = 0; ret = k3_bgp_read_temp(data, temp); @@ -261,7 +261,7 @@ static int k3_thermal_get_temp(void *devdata, int *temp) return ret; } -static const struct thermal_zone_of_device_ops k3_of_thermal_ops = { +static const struct thermal_zone_device_ops k3_of_thermal_ops = { .get_temp = k3_thermal_get_temp, }; @@ -476,10 +476,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev) writel(val, data[id].bgp->cfg2_base + data[id].ctrl_offset); bgp->ts_data[id] = &data[id]; - ti_thermal = - devm_thermal_zone_of_sensor_register(bgp->dev, id, - &data[id], - &k3_of_thermal_ops); + ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, &data[id], + &k3_of_thermal_ops); if (IS_ERR(ti_thermal)) { dev_err(bgp->dev, "thermal zone device is NULL\n"); ret = PTR_ERR(ti_thermal); -- 2.25.1