Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2775308imw; Sun, 10 Jul 2022 15:11:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uMDYXSEmj/m/4Y01NWSUWkh4hmrR64Nh5hNTbnC0BDNBCgH3o5wPyMs3+zHR4oeyC65soy X-Received: by 2002:a17:906:8a70:b0:72b:132b:1720 with SMTP id hy16-20020a1709068a7000b0072b132b1720mr15480794ejc.41.1657491088687; Sun, 10 Jul 2022 15:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657491088; cv=none; d=google.com; s=arc-20160816; b=nW/QsVF3U8ihDxwhQG9hfqnvBlKGw1/vjrAL/+SvyBra8I/iyg3ZWwuAESkJ5pOn9Q jPTIphULvHGjsGGyF8H7OH00vMRZl3UQhYHxX4U+zjkuRZFxceDcnGpUQ95p91e4KGhw OV4WOkCXIF16sW80Q5rdDQQHMkzGHGg7CQ8pmzqYEDvzp2DbqkfiXKE3gTjbdoYMqMEY G5KTXBKD01Uy6JN+kblcthvcCutMqzTNRlYdxyXBfmuKRFp7FVTs563baPV3lFe3Mlo/ aERiwoYl7zDbti1s2EMlEwWRrjRUjAAlCcjOCGUKiXsj0TY8k0AANuiICwlW8MMJpY8r TYcA== 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=OIrYHdunDMNAaNv/cr2l2s9gzRoDCmmdOZhp9vHA0Pg=; b=mye2hvTr8KNE7IRFx3GJSk1b1DkjrDsvkFAYI+WRo3k8QVjhy+c0yT06AdnYtNLoXx 0SKnt6Ip5L9gMF1lzHR8imZSnR4Y4+nPpUhBnEwYmMBakEFP5GKEsZj+DGrjnAc8Xqs3 yaas4eXRg4cI2j6H6Rg2RIeO8rHNA6uPTGL8jiL6qBIb5/uj2aZsACJW//FG6GvB9O/0 YV5VbJr0SrY5eYctWCXgKohlkAzGZqG76pGcVUu81P6TofJQJZCeoBjR/wf3QMII1xmM mNwUEPNS9guJezj63Z+AQktcT0ezDce78KeaWJqspup6ZmM1/NYZDhSLqstcbqmIWQ8w TkLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linexp-org.20210112.gappssmtp.com header.s=20210112 header.b=xzuExPhL; 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 hz4-20020a1709072ce400b00707dfcfc53asi8692159ejc.411.2022.07.10.15.11.04; Sun, 10 Jul 2022 15:11:28 -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=xzuExPhL; 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 S229562AbiGJV04 (ORCPT + 99 others); Sun, 10 Jul 2022 17:26:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229711AbiGJV0O (ORCPT ); Sun, 10 Jul 2022 17:26:14 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14D2A167EB for ; Sun, 10 Jul 2022 14:25:30 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id be14-20020a05600c1e8e00b003a04a458c54so2016082wmb.3 for ; Sun, 10 Jul 2022 14:25:29 -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=OIrYHdunDMNAaNv/cr2l2s9gzRoDCmmdOZhp9vHA0Pg=; b=xzuExPhLyZNT9Zy3FaJg94nYwhOlAT4SfKQiZUdd3fGjB7HzxRTlbiOJXjulUcfBHZ IZFIbV5UR9MpAPz6L5RXc/1LFwUbIfY/mDvZl8TlrG0tcWPU6/9TZ+IB0uwW4JXRdyVp DOWzb3doIR5w7in3sFPD7mbWEHK+rzFtsOh+LbcAOOL0BNgvUYQ25YHSOldWRkkIOjgc RkEm5UVwMeudS4OBhOhP4yf+HA7iJmCXSv5+WfUcwq5SwoHVNVR70MaTvtW9POVr44JU t3BRQqRVay5ADbzx95wU0M0BHxvdCvgCXYnKqvnlRg7CFXy8dCR2IMlFbUk6TGquiJ10 kAbg== 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=OIrYHdunDMNAaNv/cr2l2s9gzRoDCmmdOZhp9vHA0Pg=; b=f1ulzarZWNj/8dA1nf+rDmX79w9g8Gq5DGv7UNCIm9NJbyltZ/ujg0XjduimMvjuAq BQ3rd+1gPBF/dhvD5IuNBeMHlUKoAg7ZyM50a2dijIfAi8yht3iY6VgyCd+U/QWrSCKz X6yP1UZRS0tFLjyc5w+t89U7jrIyrZ9ej63iVMhg1stjqhYPtGDmwSPW8gevmMnIah0c q3BwaYhdsjMbwhMBPg2ssl6HcGVMoGDQJqo8Gj6CW3X9HJgJGwfAAcslGsP5ThZ51JSq 8AlWxOC649oXIDeb7H3yR43yf+BcgoIRtXTt0NPkdfQfgPHyiFZxzxmHKY0LQYyhwS1U cPgw== X-Gm-Message-State: AJIora/BB/f8nQ2MbHRskqzVA/vttuw0sLWzoBCegNxmFAy8zVRGTWae +8QXsDzP7oK21M7k89rS8Q1L/w== X-Received: by 2002:a05:600c:1d94:b0:3a0:4e09:122f with SMTP id p20-20020a05600c1d9400b003a04e09122fmr12765276wms.190.1657488314376; Sun, 10 Jul 2022 14:25:14 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:c7c0:6823:f3ce:2447]) by smtp.gmail.com with ESMTPSA id m19-20020a05600c3b1300b003a2dd0d21f0sm7142759wms.13.2022.07.10.14.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jul 2022 14:25:14 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, khilman@baylibre.com, abailon@baylibre.com, amitk@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Eduardo Valentin , Keerthy , linux-omap@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER) Subject: [PATCH v1 24/33] thermal/drivers/ti-soc: Switch to new of API Date: Sun, 10 Jul 2022 23:24:14 +0200 Message-Id: <20220710212423.681301-25-daniel.lezcano@linexp.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220710212423.681301-1-daniel.lezcano@linexp.org> References: <20220710212423.681301-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, T_SCC_BODY_TEXT_LINE 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. Use this new API. Signed-off-by: Daniel Lezcano --- .../thermal/ti-soc-thermal/ti-thermal-common.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 703039d8b937..89a2bd46ebcf 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -65,10 +65,10 @@ static inline int ti_thermal_hotspot_temperature(int t, int s, int c) /* thermal zone ops */ /* Get temperature callback function for thermal zone */ -static inline int __ti_thermal_get_temp(void *devdata, int *temp) +static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *temp) { struct thermal_zone_device *pcb_tz = NULL; - struct ti_thermal_data *data = devdata; + struct ti_thermal_data *data = tz->devdata; struct ti_bandgap *bgp; const struct ti_temp_sensor *s; int ret, tmp, slope, constant; @@ -85,8 +85,8 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp) return ret; /* Default constants */ - slope = thermal_zone_get_slope(data->ti_thermal); - constant = thermal_zone_get_offset(data->ti_thermal); + slope = thermal_zone_get_slope(tz); + constant = thermal_zone_get_offset(tz); pcb_tz = data->pcb_tz; /* In case pcb zone is available, use the extrapolation rule with it */ @@ -107,9 +107,9 @@ static inline int __ti_thermal_get_temp(void *devdata, int *temp) return ret; } -static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend) +static int __ti_thermal_get_trend(struct thermal_zone_device *tz, int trip, enum thermal_trend *trend) { - struct ti_thermal_data *data = p; + struct ti_thermal_data *data = tz->devdata; struct ti_bandgap *bgp; int id, tr, ret = 0; @@ -130,7 +130,7 @@ static int __ti_thermal_get_trend(void *p, int trip, enum thermal_trend *trend) return 0; } -static const struct thermal_zone_of_device_ops ti_of_thermal_ops = { +static struct thermal_zone_device_ops ti_of_thermal_ops = { .get_temp = __ti_thermal_get_temp, .get_trend = __ti_thermal_get_trend, }; @@ -170,7 +170,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, return -EINVAL; /* in case this is specified by DT */ - data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id, + data->ti_thermal = devm_thermal_of_zone_register(bgp->dev, id, data, &ti_of_thermal_ops); if (IS_ERR(data->ti_thermal)) { dev_err(bgp->dev, "thermal zone device is NULL\n"); -- 2.25.1