Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3078538ybt; Mon, 29 Jun 2020 14:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8eByXb5Kawxgpt3/XrXBnk6ZGrTsRdH8S1gj02max/+2ktY6BGMZFNqpl+mF0TyoOzNxX X-Received: by 2002:aa7:c3d8:: with SMTP id l24mr13265750edr.97.1593467175969; Mon, 29 Jun 2020 14:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593467175; cv=none; d=google.com; s=arc-20160816; b=IPsrShXQ8IVwZjd+0zM51deCgUlMEQYTTkgccbE035+qPxPnWg021wkKw7SQASqGLp TzfbbKU5b8kpWHEzu9Bu4TRceIFoWyB1J6scx1aAlIcUGlX3CsTKa1s+xazlB0SsNtZ3 CBOy1rXPey87mj2zk+lIp4ELHhTx1kUrUzk38A/U2CR0xbjQ2/I3zMkFAMKSFUkIKnXp 6qhOszQ9tvZlebdbPc7raHuJWkTHCWakTO4FAHqmAV+PfFkvYCpSpwbxo+jxzq6zChwN 6z13hYXkAK0rXxdbpyZ0TnjFVJq/tdKtG5DudvT8jqDs4470Q8a/9Xv8bvjws/7YfAWQ NIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/czzbe3TtUcJIflJ99q2lIskXBgVNXfpcq83W982SW4=; b=zaoV4V+snTTNktqaxWISeowLG3hZ5NYk7Ud4ogOzJPSv5mCc36z/FABTG6whbRGWxh vH5D+QjB/+UflBNVnOvzpMfmu0P5c04YdajnAy2kbmrgEeFoudPRaHvUuO969DMLMuc2 iixEImL+DELpsKGDJFtnSLHLtVDf/p10Z+FAG2oxd5YpT9SFKGV+bc+1KkHO3e4i4gv8 2fzbv2nVg2hlm0v5LMp655/WHv+fEzockAHiKFfJNrfcfpirff8sStScWHCWeDhteY/t nY15734VY+O21jb6yFBDtRTxYz/xAgs8+Sz21b4/YB4AbQcmqkwD//524EUKQzp+8ZAv aY4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b="WeSAP/a5"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a16si468717eju.669.2020.06.29.14.45.52; Mon, 29 Jun 2020 14:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b="WeSAP/a5"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404045AbgF2Voz (ORCPT + 99 others); Mon, 29 Jun 2020 17:44:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbgF2Shp (ORCPT ); Mon, 29 Jun 2020 14:37:45 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9446DC00F83F for ; Mon, 29 Jun 2020 05:49:02 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id e3so5265952uan.2 for ; Mon, 29 Jun 2020 05:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/czzbe3TtUcJIflJ99q2lIskXBgVNXfpcq83W982SW4=; b=WeSAP/a5lZp6nQMEdDIM8axmsEfnvdtP2chd3VGBSckQwa2U21YukiLtyPPobyXRuz qYvGnoJy2SUKgfnYrOr3jRhoupwpMs3QX+xGwrqTeAtGDEL8iTdjC6PN+tFU5iplVnnH 3ucRfvHL7WjJ+gtGhev0U+/hV5HrD3ymzqRKeQrv4+5ImAO6zhR9vLGZVRJQqMfrVxZw uToRn6fmJ1MVQd0H0L4UGrVpsm529MFKG1jOf/g8cOtAWlx/5fXAYzhwDiBp5fWyHkNG fKlGAU5e05jHLGweiiNV7g/5A5MRWrfBh7NP6PF2Tq8mI41CfWsoaTZ3omYxPZGLOXHS jCbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/czzbe3TtUcJIflJ99q2lIskXBgVNXfpcq83W982SW4=; b=AFzurFHWbP+zqdygNRe1E5DbmpSNbOBB6SrizuXtqIcDpPaeMLNALhRdmaTJlsY3lH RCyZrbmmRv8caNSCELATCy1gjrS+BC9FD1YDQ9UA5S2XmW5x7oCHZRNphUsI2GTzAL1l 18txEuy3439ka8826HxuYcUhwnXcRRMSXW7cSvxpskYzdztTfPxWeSmzxGcLwCWsMABV FyPZC8kY/FxHfzt5f+j5br2s2dKEFO1c11QR6kKSZTtCsWrzrbwW2Weq3RJ5HMnEFlVW XwxpNKohlnAIQL1uWOpZ70O2RzUyB1Dy+nyvw5kBakEwphj3Nz4JrU/6zcs7itd2xOOR aXAA== X-Gm-Message-State: AOAM530uWfHwg1W64LgrcGCbcP902XhBmpMDKldpgw5hqZiNYn8hcELq /wpsH2ubX8fYH7fHMFI2dEtsPZXXpIZ/2ewGaB3wHA== X-Received: by 2002:ab0:232:: with SMTP id 47mr10473617uas.48.1593434941649; Mon, 29 Jun 2020 05:49:01 -0700 (PDT) MIME-Version: 1.0 References: <20200629122925.21729-1-andrzej.p@collabora.com> <20200629122925.21729-12-andrzej.p@collabora.com> In-Reply-To: <20200629122925.21729-12-andrzej.p@collabora.com> From: Amit Kucheria Date: Mon, 29 Jun 2020 18:18:50 +0530 Message-ID: Subject: Re: [PATCH v7 11/11] thermal: Rename set_mode() to change_mode() To: Andrzej Pietrasiewicz Cc: Linux PM list , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org, lakml , linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, "Rafael J . Wysocki" , Len Brown , Vishal Kulkarni , "David S . Miller" , Jiri Pirko , Ido Schimmel , Johannes Berg , Emmanuel Grumbach , Luca Coelho , Intel Linux Wireless , Kalle Valo , Peter Kaestle , Darren Hart , Andy Shevchenko , Sebastian Reichel , Miquel Raynal , Daniel Lezcano , Support Opensource , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Heiko Stuebner , Orson Zhai , Baolin Wang , Chunyan Zhang , Zhang Rui , Allison Randal , Enrico Weigelt , Gayatri Kammela , Thomas Gleixner , Bartlomiej Zolnierkiewicz , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Jun 29, 2020 at 6:00 PM Andrzej Pietrasiewicz wrote: > > set_mode() is only called when tzd's mode is about to change. Actual > setting is performed in thermal_core, in thermal_zone_device_set_mode(). > The meaning of set_mode() callback is actually to notify the driver about > the mode being changed and giving the driver a chance to oppose such > change. > > To better reflect the purpose of the method rename it to change_mode() > > Signed-off-by: Andrzej Pietrasiewicz > [for acerhdf] > Acked-by: Peter Kaestle > Reviewed-by: Bartlomiej Zolnierkiewicz Reviewed-by: Amit Kucheria > --- > drivers/platform/x86/acerhdf.c | 6 +++--- > drivers/thermal/imx_thermal.c | 8 ++++---- > drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 +++--- > drivers/thermal/intel/intel_quark_dts_thermal.c | 6 +++--- > drivers/thermal/thermal_core.c | 4 ++-- > include/linux/thermal.h | 2 +- > 6 files changed, 16 insertions(+), 16 deletions(-) > > diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c > index 76323855c80c..f816a8a13039 100644 > --- a/drivers/platform/x86/acerhdf.c > +++ b/drivers/platform/x86/acerhdf.c > @@ -413,8 +413,8 @@ static inline void acerhdf_enable_kernelmode(void) > * the temperature and the fan. > * disabled: the BIOS takes control of the fan. > */ > -static int acerhdf_set_mode(struct thermal_zone_device *thermal, > - enum thermal_device_mode mode) > +static int acerhdf_change_mode(struct thermal_zone_device *thermal, > + enum thermal_device_mode mode) > { > if (mode == THERMAL_DEVICE_DISABLED && kernelmode) > acerhdf_revert_to_bios_mode(); > @@ -473,7 +473,7 @@ static struct thermal_zone_device_ops acerhdf_dev_ops = { > .bind = acerhdf_bind, > .unbind = acerhdf_unbind, > .get_temp = acerhdf_get_ec_temp, > - .set_mode = acerhdf_set_mode, > + .change_mode = acerhdf_change_mode, > .get_trip_type = acerhdf_get_trip_type, > .get_trip_hyst = acerhdf_get_trip_hyst, > .get_trip_temp = acerhdf_get_trip_temp, > diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c > index a02398118d88..9700ae39feb7 100644 > --- a/drivers/thermal/imx_thermal.c > +++ b/drivers/thermal/imx_thermal.c > @@ -330,8 +330,8 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp) > return 0; > } > > -static int imx_set_mode(struct thermal_zone_device *tz, > - enum thermal_device_mode mode) > +static int imx_change_mode(struct thermal_zone_device *tz, > + enum thermal_device_mode mode) > { > struct imx_thermal_data *data = tz->devdata; > struct regmap *map = data->tempmon; > @@ -447,7 +447,7 @@ static struct thermal_zone_device_ops imx_tz_ops = { > .bind = imx_bind, > .unbind = imx_unbind, > .get_temp = imx_get_temp, > - .set_mode = imx_set_mode, > + .change_mode = imx_change_mode, > .get_trip_type = imx_get_trip_type, > .get_trip_temp = imx_get_trip_temp, > .get_crit_temp = imx_get_crit_temp, > @@ -860,7 +860,7 @@ static int __maybe_unused imx_thermal_suspend(struct device *dev) > * Need to disable thermal sensor, otherwise, when thermal core > * try to get temperature before thermal sensor resume, a wrong > * temperature will be read as the thermal sensor is powered > - * down. This is done in set_mode() operation called from > + * down. This is done in change_mode() operation called from > * thermal_zone_device_disable() > */ > ret = thermal_zone_device_disable(data->tz); > diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > index ce49d3b100d5..d3732f624913 100644 > --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c > @@ -377,8 +377,8 @@ static int int3400_thermal_get_temp(struct thermal_zone_device *thermal, > return 0; > } > > -static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, > - enum thermal_device_mode mode) > +static int int3400_thermal_change_mode(struct thermal_zone_device *thermal, > + enum thermal_device_mode mode) > { > struct int3400_thermal_priv *priv = thermal->devdata; > int result = 0; > @@ -399,7 +399,7 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, > > static struct thermal_zone_device_ops int3400_thermal_ops = { > .get_temp = int3400_thermal_get_temp, > - .set_mode = int3400_thermal_set_mode, > + .change_mode = int3400_thermal_change_mode, > }; > > static struct thermal_zone_params int3400_thermal_params = { > diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c > index e29c3e330b17..3eafc6b0e6c3 100644 > --- a/drivers/thermal/intel/intel_quark_dts_thermal.c > +++ b/drivers/thermal/intel/intel_quark_dts_thermal.c > @@ -298,8 +298,8 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd, > return 0; > } > > -static int sys_set_mode(struct thermal_zone_device *tzd, > - enum thermal_device_mode mode) > +static int sys_change_mode(struct thermal_zone_device *tzd, > + enum thermal_device_mode mode) > { > int ret; > > @@ -319,7 +319,7 @@ static struct thermal_zone_device_ops tzone_ops = { > .get_trip_type = sys_get_trip_type, > .set_trip_temp = sys_set_trip_temp, > .get_crit_temp = sys_get_crit_temp, > - .set_mode = sys_set_mode, > + .change_mode = sys_change_mode, > }; > > static void free_soc_dts(struct soc_sensor_entry *aux_entry) > diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c > index e613f5c07bad..a61e91513584 100644 > --- a/drivers/thermal/thermal_core.c > +++ b/drivers/thermal/thermal_core.c > @@ -482,8 +482,8 @@ static int thermal_zone_device_set_mode(struct thermal_zone_device *tz, > return ret; > } > > - if (tz->ops->set_mode) > - ret = tz->ops->set_mode(tz, mode); > + if (tz->ops->change_mode) > + ret = tz->ops->change_mode(tz, mode); > > if (!ret) > tz->mode = mode; > diff --git a/include/linux/thermal.h b/include/linux/thermal.h > index df013c39ba9b..b9efaa780d88 100644 > --- a/include/linux/thermal.h > +++ b/include/linux/thermal.h > @@ -76,7 +76,7 @@ struct thermal_zone_device_ops { > struct thermal_cooling_device *); > int (*get_temp) (struct thermal_zone_device *, int *); > int (*set_trips) (struct thermal_zone_device *, int, int); > - int (*set_mode) (struct thermal_zone_device *, > + int (*change_mode) (struct thermal_zone_device *, > enum thermal_device_mode); > int (*get_trip_type) (struct thermal_zone_device *, int, > enum thermal_trip_type *); > -- > 2.17.1 >