Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp1141311rwb; Thu, 4 Aug 2022 18:28:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6AU78GwCgbQo/FYFHg53Klw6K/fQ4M+54eGczaT3M7OXWO3w6WmUxPaAlzzlPnPJFfx0SC X-Received: by 2002:a17:907:1c87:b0:6f0:29ea:cc01 with SMTP id nb7-20020a1709071c8700b006f029eacc01mr3462934ejc.671.1659662894566; Thu, 04 Aug 2022 18:28:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659662894; cv=none; d=google.com; s=arc-20160816; b=kvkxHekJCk1/rRd2ZIJ830Q3RdQFxeX8HFw1yPftdRdrapZetJHOFhQyl+a2RRKx0T wRajuFZnjVbj4KzoRE0OkpFjo2wiDQH7pKY3g5kvyn5aJ804Jp7KiiGRl0+vAKgeMEfs UVkoSvAdHtKgMPISrLJc7IIQSbvPFOM3JtFFsuzCZAp0WPl2Vvb+dT49/McjC4qvJ3EU CFOjlXooV6RaUPy50zEFiVyPzdmdXrKbUuwicjodGmvJUyEpFV4Cw2czMa7dIxvSuaM5 o9nfssEMlVOFMRaGf9lsqRDz8KEV6v5KX48I71aOJHetAP/aBaB0N9lxbIg0CAHZy0ed x9tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xVg4Rc1wyAEPnHP+dLUX1rSBue1ZBaUejyLmG1hs/xM=; b=P2bMLSGogsBnnz6aLvGv5ddqCWTXilVyUo8/rAJ7LrjTUrMRpeCjdRyrCxixaZniHn +QHlwyLF0A9BwVOR0U5SW6+QNX6HZSsyuq2KvBet2xNEm0MIv5a1lxtf2QTxRB3uR72N Y/maRGrELj+GlYH32kcK7hjkE2u+dnaY9rEIMaayNajt98BQypf+rMT2b6QKXVrbGVoH Vec86va5cSkup8KtuTbSy7hauFnVsxzMW+nno2h2Lw7YQoLKUorwsC00xK+bueExnjQk Ay8qVhOrCff5zVUgsB+LplOvCGmC8aC7RrWRsptfM0vr1BWLery1ox6N+If0dxIIx/CR OwBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RKJBGrRO; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga38-20020a1709070c2600b007304a1ceb95si2907217ejc.399.2022.08.04.18.27.48; Thu, 04 Aug 2022 18:28:14 -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=@ti.com header.s=ti-com-17Q1 header.b=RKJBGrRO; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235602AbiHEBUG (ORCPT + 99 others); Thu, 4 Aug 2022 21:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbiHEBUE (ORCPT ); Thu, 4 Aug 2022 21:20:04 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48D0871BCE; Thu, 4 Aug 2022 18:20:03 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2751JdLK127630; Thu, 4 Aug 2022 20:19:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1659662379; bh=xVg4Rc1wyAEPnHP+dLUX1rSBue1ZBaUejyLmG1hs/xM=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=RKJBGrROxMIOhbL1NYPde9O27IUb2mWnVnJJcwri26pQkiPeCWorOh97k8QjQDlhg 8sF6awfejheK8JnWrUQYMUetjeU9a+jHFmIrYjJYwire4c9YEQTSaCAzha7e3pCqiR qiRYAkoYZSwc/RocVGz70IfkFeDHizS0e20+gSRk= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2751JdVi006868 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 4 Aug 2022 20:19:39 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 4 Aug 2022 20:19:38 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 4 Aug 2022 20:19:38 -0500 Received: from [10.250.232.200] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2751JTAX008557; Thu, 4 Aug 2022 20:19:30 -0500 Message-ID: Date: Fri, 5 Aug 2022 06:49:28 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v5 24/33] thermal/drivers/ti-soc: Switch to new of API Content-Language: en-US To: Daniel Lezcano , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Eduardo Valentin , Amit Kucheria , "open list:TI BANDGAP AND THERMAL DRIVER" References: <20220804224349.1926752-1-daniel.lezcano@linexp.org> <20220804224349.1926752-25-daniel.lezcano@linexp.org> From: "J, KEERTHY" In-Reply-To: <20220804224349.1926752-25-daniel.lezcano@linexp.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On 8/5/2022 4:13 AM, Daniel Lezcano wrote: > 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. Acked-by: Keerthy > > 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..8a9055bd376e 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 const 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");