From patchwork Fri Jun 21 13:22:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 167386 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp740868ilk; Fri, 21 Jun 2019 06:23:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfx8XpjvIEP1jMvwOGe0NmUro5q2q425DkUOW/uVY1uHFYnrxwTTLky1GZuzHOrPUx4Aj2 X-Received: by 2002:a63:f852:: with SMTP id v18mr13118447pgj.429.1561123412821; Fri, 21 Jun 2019 06:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561123412; cv=none; d=google.com; s=arc-20160816; b=IAdW2y/LBxZh5FS+CyR54bsQnhzvOtUJBjiV/dGlgXhBCIUuxNFIJvpIErh0cPjeDL FUfLEA/UU+kTDznSriJVTLmJLZsKptbehbECOp4wqFABKz9LWofRSyJiS7QF7k20fJoY H/HGd9nAiKXGFB1MVnUN5JPLD6gwrkeCfYHjGpQTxZ03gATskBqJ1LNws4QYLNQ9E+hr XsHwYh0fTOUyr08ppSiVjCB04Ql5GLnif7MT51mrdZUWcSrilg5PWIfjTLwplia+ex/f /ad0TFngQBU8cEySkJItBof738CDMQge+BKfkua3YR2JRqDy1eIqBCNDKDnlKgpprGO8 eHPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Gx8HrKvqg1+iiIrNTNFr/x4ncyqpR/tpssMykxjZoIo=; b=egxZVF3Ej0oBJ1C/0ePoHZebFgMrKLStl3CNnMjZrOQF7vdxW988zJaY9fcSBVJuhT zRwmHjkD3UZaECNgzvNww4XGeffyrykspyUojfDTAqAjgvUrfB45rQ2LEHnSTOcwTAUP 09VATE2WTggoKqo5Xj4ydbywVT5S2iUoxVbEYHaWy4fCp38TB/QQfIBD4At+CQJmoMt5 WCkkMgmC3/aN4+cshrHlaOeUE11xA2POg+QunnjN1PcwOK32eyqrrTXrSJqokHim67Bl 45E7qGiUN0l0HGV8kUzSXtuKAbZ4f4SlORb7OqjGiJ8n/d0OM8v1Xnd2eqIceCILmUBW 6vpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xg/Z0J/K"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si833831pfe.129.2019.06.21.06.23.32; Fri, 21 Jun 2019 06:23:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xg/Z0J/K"; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726190AbfFUNXb (ORCPT + 5 others); Fri, 21 Jun 2019 09:23:31 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34775 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfFUNXa (ORCPT ); Fri, 21 Jun 2019 09:23:30 -0400 Received: by mail-wm1-f65.google.com with SMTP id w9so9153227wmd.1 for ; Fri, 21 Jun 2019 06:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gx8HrKvqg1+iiIrNTNFr/x4ncyqpR/tpssMykxjZoIo=; b=xg/Z0J/KgZDs5GNjVp0/tt7hCsJbGidqTEhq9Lgyniryk6kYV7gIBCMfh1QMNVHXAg q4GiZE2HWVVCpHhhgS4mRH61TX94rjq51/V4eT8uqX0y9GCEHdEwcP71GUbK6ZUbzn80 T4IcNuoTd5Gd9IJTk5YD56OeJ8zeOVRiGRTLcWvGLAldfV+j6FL8B7puPMwwsDeukdlS 6YF62dMpKA5nLU0jDmzI1FOcHLHqPcs5c33YIZOor0TmgU97X/bFuzXusr4wh+uSnhXN ReooB3BmmLa3AoXPfbV+wRxixaEeQl/5TXDFhY/bii1BhFkxCIDsE18/0ZYvm6w6X2bx XADA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gx8HrKvqg1+iiIrNTNFr/x4ncyqpR/tpssMykxjZoIo=; b=hxGnL6WDqqmRl7ZVJNNOdKxGeB7XiHCG9l9L7IsXAHFkR40m+NiVocss4R6sQLrVqF Gj+EkVZ8wNPPG+m8caqsjoA4z6ofaZqaYMFXgYABxi97HkPQwMp5bSLO2x9oFe9aUm68 zbhgfNYsDp6d+ONOgPn7r2hbslVPxm+kkA4xKqpsWktYVbAZr92ud4dbrpQuUJagQvgx GZY7Kd0foNMlSbmk6tt77LsoMoAZPuid6Ky3OtJnEL6QV7KsNrsAfdrD9zQ5PQHk+NBK s8rPCqyz0pGq1bYIpLtmE0FqbTsITkSTg14eU0dZOXllKbTG3aW50lyqfftl61EW4p8y wQ0g== X-Gm-Message-State: APjAAAVgIYq2Xfyns7jDvRGiHoL05clYpeI4KkL07pwF4wEfCKDsg3pv 8QoYmCPB+Jxl9X+SonaIuJ5HbQ== X-Received: by 2002:a1c:d107:: with SMTP id i7mr3682724wmg.92.1561123407785; Fri, 21 Jun 2019 06:23:27 -0700 (PDT) Received: from clegane.local (206.105.129.77.rev.sfr.net. [77.129.105.206]) by smtp.gmail.com with ESMTPSA id s188sm1981234wmf.40.2019.06.21.06.23.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 06:23:27 -0700 (PDT) From: Daniel Lezcano To: viresh.kumar@linaro.org Cc: edubezval@gmail.com, linux-kernel@vger.kernel.org, Sudeep Holla , "Rafael J. Wysocki" , Amit Daniel Kachhap , Javi Merino , Zhang Rui , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Keerthy , linux-pm@vger.kernel.org (open list:CPU FREQUENCY DRIVERS - ARM BIG LITTLE), linux-arm-kernel@lists.infradead.org (moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE), linux-omap@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER) Subject: [PATCH 2/6] thermal/drivers/cpu_cooling: Unregister with the policy Date: Fri, 21 Jun 2019 15:22:58 +0200 Message-Id: <20190621132302.30414-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190621132302.30414-1-daniel.lezcano@linaro.org> References: <20190621132302.30414-1-daniel.lezcano@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Currently the function cpufreq_cooling_register() returns a cooling device pointer which is used back as a pointer to call the function cpufreq_cooling_unregister(). Even if it is correct, it would make sense to not leak the structure inside a cpufreq driver and keep the code thermal code self-encapsulate. Moreover, that forces to add an extra variable in each driver using this function. Instead of passing the cooling device to unregister, pass the policy. Signed-off-by: Daniel Lezcano --- drivers/cpufreq/arm_big_little.c | 2 +- drivers/cpufreq/cpufreq.c | 2 +- drivers/thermal/cpu_cooling.c | 18 ++++++++++-------- drivers/thermal/imx_thermal.c | 4 ++-- .../thermal/ti-soc-thermal/ti-thermal-common.c | 2 +- include/linux/cpu_cooling.h | 6 +++--- 6 files changed, 18 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index 7fe52fcddcf1..6b243202caa9 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c @@ -502,7 +502,7 @@ static int bL_cpufreq_exit(struct cpufreq_policy *policy) int cur_cluster = cpu_to_cluster(policy->cpu); if (cur_cluster < MAX_CLUSTERS) { - cpufreq_cooling_unregister(cdev[cur_cluster]); + cpufreq_cooling_unregister(policy); cdev[cur_cluster] = NULL; } diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 7c72f7d3509c..dfbc9bea606c 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1469,7 +1469,7 @@ static int cpufreq_offline(unsigned int cpu) } if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) { - cpufreq_cooling_unregister(policy->cdev); + cpufreq_cooling_unregister(policy); policy->cdev = NULL; } diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 83486775e593..007c7c6bf845 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -78,6 +78,7 @@ struct cpufreq_cooling_device { struct cpufreq_policy *policy; struct list_head node; struct time_in_idle *idle_time; + struct thermal_cooling_device *cdev; }; static DEFINE_IDA(cpufreq_ida); @@ -606,6 +607,7 @@ __cpufreq_cooling_register(struct device_node *np, goto remove_ida; cpufreq_cdev->clipped_freq = get_state_freq(cpufreq_cdev, 0); + cpufreq_cdev->cdev = cdev; mutex_lock(&cooling_list_lock); /* Register the notifier for first cpufreq cooling device */ @@ -699,18 +701,18 @@ EXPORT_SYMBOL_GPL(of_cpufreq_cooling_register); * * This interface function unregisters the "thermal-cpufreq-%x" cooling device. */ -void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) +void cpufreq_cooling_unregister(struct cpufreq_policy *policy) { struct cpufreq_cooling_device *cpufreq_cdev; bool last; - if (!cdev) - return; - - cpufreq_cdev = cdev->devdata; - mutex_lock(&cooling_list_lock); - list_del(&cpufreq_cdev->node); + list_for_each_entry(cpufreq_cdev, &cpufreq_cdev_list, node) { + if (cpufreq_cdev->policy == policy) { + list_del(&cpufreq_cdev->node); + break; + } + } /* Unregister the notifier for the last cpufreq cooling device */ last = list_empty(&cpufreq_cdev_list); mutex_unlock(&cooling_list_lock); @@ -719,7 +721,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block, CPUFREQ_POLICY_NOTIFIER); - thermal_cooling_device_unregister(cdev); + thermal_cooling_device_unregister(cpufreq_cdev->cdev); ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id); kfree(cpufreq_cdev->idle_time); kfree(cpufreq_cdev); diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index bb6754a5342c..6746f1b73eb7 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -680,7 +680,7 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) { - cpufreq_cooling_unregister(data->cdev); + cpufreq_cooling_unregister(data->policy); cpufreq_cpu_put(data->policy); } @@ -872,7 +872,7 @@ static int imx_thermal_remove(struct platform_device *pdev) clk_disable_unprepare(data->thermal_clk); thermal_zone_device_unregister(data->tz); - cpufreq_cooling_unregister(data->cdev); + cpufreq_cooling_unregister(data->policy); cpufreq_cpu_put(data->policy); return 0; diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index b4f981daeaf2..217b1aae8b4f 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -277,7 +277,7 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id) data = ti_bandgap_get_sensor_data(bgp, id); if (data) { - cpufreq_cooling_unregister(data->cool_dev); + cpufreq_cooling_unregister(data->policy); if (data->policy) cpufreq_cpu_put(data->policy); } diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index bae54bb7c048..89f469ee4be4 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -29,9 +29,9 @@ cpufreq_cooling_register(struct cpufreq_policy *policy); /** * cpufreq_cooling_unregister - function to remove cpufreq cooling device. - * @cdev: thermal cooling device pointer. + * @policy: cpufreq policy */ -void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); +void cpufreq_cooling_unregister(struct cpufreq_policy *policy); #else /* !CONFIG_CPU_THERMAL */ static inline struct thermal_cooling_device * @@ -41,7 +41,7 @@ cpufreq_cooling_register(struct cpufreq_policy *policy) } static inline -void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) +void cpufreq_cooling_unregister(struct cpufreq_policy *policy) { return; } From patchwork Fri Jun 21 13:23:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 167389 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp740970ilk; Fri, 21 Jun 2019 06:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyInW2EURcLaNavuH7QuNrBJYfZ3tJEJq6EjPfzgfZMnXKzCBq8NDvZhCbThIhfWChFVmYh X-Received: by 2002:a17:902:b187:: with SMTP id s7mr39786950plr.309.1561123417954; Fri, 21 Jun 2019 06:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561123417; cv=none; d=google.com; s=arc-20160816; b=IQ6Z2Jzw4jtrZQ7ob5uED5FJNonPrdCHuBziEysKzPyC+6djX5lJJ+YOgjFOxc3qsW yyCyuVz1pwxrSzWWSrnZ6VUedgXd6tyzLjYCpp+DdnaK241zn+tfpgVoqia4SJBxc3HJ qqCTiu6ys5MCfQbkJZoeJasLcgYx/v3D8/atrXuRu2hMwG54e0S7xTWXIVpIM0kZqqKP RflC/zQhBRxoWL2/9TCUTGWuKKYFvm3admFuqzQKIk9mJaOgKn5xqxkK+N1rvLh4F2D+ v85E+wa0iRTMfwdxTYXXZz5LvEBvtZYx05/bKhniF0wWNPXAlb8AX3vHE4cScvgLG06t Qqiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=hWOyvG8gK3Yd2gZuZPX+zS+OzCMre8gWSxnhV9rJDR4=; b=ceYNGq6kkRVEaWAst1LchGRmSCT8hRRXIdO+h3U3lXJZ45GT6pcbRcoqZp6/+uIRjN fUR3tYpbHb+9cG7Wk75KqOXY+ErfECJWU8O1S0j8CbLZD+vuF4kFYhewr9r6fOTayp0d /Rqlf5ymH6VxmvSRmrl1/x9qpw8oi2fEeq9RRmILg8QGUlPbtt0t58Y8RvWBLpFUyJK4 mS6I6TkBhRRqfZt4OJNcYP+viKsWu+Cpsu8SrnICEVh0SiJo1evDCxIL0iNF+YTfGkw0 yX7dqeXJ/ctsAID49gb/2V28t+UWwIcI5ZKpCmG5YtEi/aifV5OhAVsbcffN6p6LmeDv vdRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c36ZpSew; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y16si833831pfe.129.2019.06.21.06.23.37; Fri, 21 Jun 2019 06:23:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c36ZpSew; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726237AbfFUNXg (ORCPT + 5 others); Fri, 21 Jun 2019 09:23:36 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51955 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfFUNXg (ORCPT ); Fri, 21 Jun 2019 09:23:36 -0400 Received: by mail-wm1-f66.google.com with SMTP id 207so6336406wma.1 for ; Fri, 21 Jun 2019 06:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hWOyvG8gK3Yd2gZuZPX+zS+OzCMre8gWSxnhV9rJDR4=; b=c36ZpSewLyxdsNlrsvfl54dP1d3jg1M3kR6dJKnAlk5Kh6PlPsU1RM1YhgbelAsiB8 KpDVG6V6mFy2Emmx9iXwPq8EIC6KiyewIFRtn7C86MwlueFkplHP1GF74Vi4K12kxjIB x2I3j7ScntkAxx19yk6Z339XPBZ1fQkRdWTGiUJ3xsUlU79u9TGcvn2+CrijnwNf2JiF u9o421T2miZQiLckihrPw66oLEHr1elWqUNNCGt020T49WC32Jsb5xkOQTHBdFQpYeTU G3D+d7LeI1PWxZ2zpYpm8PnS4+UsS0KRK3B6tZGx66Xw5HHqzyGTQbJbQjUz6uvy0yvh rIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hWOyvG8gK3Yd2gZuZPX+zS+OzCMre8gWSxnhV9rJDR4=; b=av908loEO5ZqiL1zwlkOujWrrrsfWHN08EfsRMtTyscgdKxGAeEo7CmnS60oeziPU4 WDnzexcMYuzoaQwLr2fuRuXaXhaRY996qCWTOVUXRQ2hgStGbkrOup+b8o6tLjh95yLb dhoK6C2I9Ig226BkNQawl61aY1sUx+VJXnAw4CQ9cdn2yHMPWgQqVrgvSapbNh8llfTW 62Ll1TLVVYiwcswT2Ym129DAMlDUcChbNqQm7gU4bEKKx8VsWly2dC2w+lCfOZz/cdeH umaknbBHM9tOlaxTqWQVs+QwCxYsDxkT4W9zxa9GWBlHU9AdxlqAWvJyPW6YRn1tKDmD QOqw== X-Gm-Message-State: APjAAAWuGmVAANScfbFH+OK6TPmcfMtbMboNi0LxJCSi7QYOC1ClqvLP EtrCpGEdWHGObmeWbkVifhzqOw== X-Received: by 2002:a1c:730d:: with SMTP id d13mr4066497wmb.88.1561123414277; Fri, 21 Jun 2019 06:23:34 -0700 (PDT) Received: from clegane.local (206.105.129.77.rev.sfr.net. [77.129.105.206]) by smtp.gmail.com with ESMTPSA id s188sm1981234wmf.40.2019.06.21.06.23.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 06:23:33 -0700 (PDT) From: Daniel Lezcano To: viresh.kumar@linaro.org Cc: edubezval@gmail.com, linux-kernel@vger.kernel.org, Keerthy , Zhang Rui , linux-pm@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER), linux-omap@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER) Subject: [PATCH 6/6] thermal/drivers/ti: Remove cooling device usage Date: Fri, 21 Jun 2019 15:23:02 +0200 Message-Id: <20190621132302.30414-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190621132302.30414-1-daniel.lezcano@linaro.org> References: <20190621132302.30414-1-daniel.lezcano@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The cpufreq_cooling_unregister() function uses now the policy to unregister itself. The only purpose of the cooling device pointer is to unregister the cpu cooling device. As there is no more need of this pointer, remove it. Signed-off-by: Daniel Lezcano --- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 217b1aae8b4f..170b70b6ec61 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -41,7 +41,6 @@ struct ti_thermal_data { struct cpufreq_policy *policy; struct thermal_zone_device *ti_thermal; struct thermal_zone_device *pcb_tz; - struct thermal_cooling_device *cool_dev; struct ti_bandgap *bgp; enum thermal_device_mode mode; struct work_struct thermal_wq; @@ -233,6 +232,7 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) { struct ti_thermal_data *data; struct device_node *np = bgp->dev->of_node; + struct thermal_cooling_device *cdev; /* * We are assuming here that if one deploys the zone @@ -256,9 +256,9 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) } /* Register cooling device */ - data->cool_dev = cpufreq_cooling_register(data->policy); - if (IS_ERR(data->cool_dev)) { - int ret = PTR_ERR(data->cool_dev); + cdev = cpufreq_cooling_register(data->policy); + if (IS_ERR(cdev)) { + int ret = PTR_ERR(cdev); dev_err(bgp->dev, "Failed to register cpu cooling device %d\n", ret); cpufreq_cpu_put(data->policy);