From patchwork Mon Jan 25 16:44:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101102 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1466574lbb; Mon, 25 Jan 2016 08:45:19 -0800 (PST) X-Received: by 10.98.32.25 with SMTP id g25mr27270256pfg.20.1453740319204; Mon, 25 Jan 2016 08:45:19 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp7si34682591pab.66.2016.01.25.08.45.16; Mon, 25 Jan 2016 08:45:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933395AbcAYQpN (ORCPT + 30 others); Mon, 25 Jan 2016 11:45:13 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:57545 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933215AbcAYQpH (ORCPT ); Mon, 25 Jan 2016 11:45:07 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0MKyv2-1aNkFk2SyO-0000Yb; Mon, 25 Jan 2016 17:44:32 +0100 From: Arnd Bergmann To: Zhang Rui , Eduardo Valentin Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, spear-devel@list.st.com, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] thermal: spear: use __maybe_unused for PM functions Date: Mon, 25 Jan 2016 17:44:10 +0100 Message-Id: <1453740264-1972562-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453740264-1972562-1-git-send-email-arnd@arndb.de> References: <1453740264-1972562-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:ISgH7xm9zOWbsR1nJmieQszt4YFuQu1kMuHPFjPt6wm/iASqR5q uju87MB+5cK8LEZS97mMv2OxeThyAhHvkYqNOXJZEIhkoRuTI28nuui8bJ/6H0yw+CFFW9p YRtKivWw6qETv8qogd6wu/kmuFpKhGFIl+Ajhyr+0SrLM2+qxXcf7dlWbBv+yF7WgIXrqdj z8T2iLfroQMAPDiJxfQnw== X-UI-Out-Filterresults: notjunk:1; V01:K0:OxqNqhCnftg=:7XEa93WCSatsUwgzx6o1Eo PCksaO0NksDjjFGR4FIV+lMGkgV0Z2xXRDvpgCPo4992G3F2sd+LZVLMDBXM0hShpNLZgV9yX i8paRiP7MKdLQjgp0aKbq15GilTFhPTmoTzku2O4eTc0X/J9m0WIPqJlUt/Hy//t+CrYqJA/P Qe9+SnZSwXHdKpyfEGzcbWrOqfDc/7cVxrijZRUbSzWWkmokVwsWrisWilF3lMsrReenCJ8bG um8Ycl/QNYits0weaTyaHdc6pBYv4jdMldGgBpoTJMToLkm2IkgtfBwQKrl+3DZyEzA/ysq+8 cLYCxLCLckDhwDESQIKBDnqNBeSuUvjHjsBIX0TqHIhjBIox0rPdGKCghYbzkBwmy8Tc4kncg A2nVGUFqsS5wsjLX0nZyQWPCAjPTzn2Gip85Xh578w9bMOh5HCIy57KSBsPQTl5tHJWBmQgi7 GOXfDCdZhszHMx++JeqFr2YEPp62VLrBfBpGBoCCjDWlrxMOAj5y6W0gMW7yiuyDJI4mu0Pqt 9/aj5yaqDVjVb7fYd0w/bqpN26Gh9dnBGyQJPTaXTYj9lV9SsRktyjHP2zkJMLp7LWX6ISRC7 uCoaYwT5RUdrc0pPdmSGigTYqeYfVRbCFw4UgPQWngYJw71wcMAkNxCMX0OI8/lpkk4UXENte K47ZkWNsNBAuAk7qeCfXi28TcjFqJCbFsHCYjTy2PaSN/fCsM7mYPvVio1HPK5lIHjW4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The spear thermal driver hides its suspend/resume function conditionally based on CONFIG_PM, but references them based on CONFIG_PM_SLEEP, so we get a warning if the former is set but the latter is not: thermal/spear_thermal.c:58:12: warning: 'spear_thermal_suspend' defined but not used [-Wunused-function] thermal/spear_thermal.c:75:12: warning: 'spear_thermal_resume' defined but not used [-Wunused-function] This removes the #ifdef and instead uses a __maybe_uninitialized annotation to avoid the warning and improve compile-time coverage. Signed-off-by: Arnd Bergmann --- drivers/thermal/spear_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index 534dd9136662..81b35aace9de 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -54,8 +54,7 @@ static struct thermal_zone_device_ops ops = { .get_temp = thermal_get_temp, }; -#ifdef CONFIG_PM -static int spear_thermal_suspend(struct device *dev) +static int __maybe_unused spear_thermal_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -72,7 +71,7 @@ static int spear_thermal_suspend(struct device *dev) return 0; } -static int spear_thermal_resume(struct device *dev) +static int __maybe_unused spear_thermal_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); @@ -94,7 +93,6 @@ static int spear_thermal_resume(struct device *dev) return 0; } -#endif static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend, spear_thermal_resume); From patchwork Mon Jan 25 16:44:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101104 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1466344lbb; Mon, 25 Jan 2016 08:44:56 -0800 (PST) X-Received: by 10.66.155.167 with SMTP id vx7mr26890788pab.109.1453740294605; Mon, 25 Jan 2016 08:44:54 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fd2si8025385pab.194.2016.01.25.08.44.54; Mon, 25 Jan 2016 08:44:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933078AbcAYQow (ORCPT + 30 others); Mon, 25 Jan 2016 11:44:52 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:51783 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932910AbcAYQor (ORCPT ); Mon, 25 Jan 2016 11:44:47 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0M78je-1a8x9h3D78-00x5IV; Mon, 25 Jan 2016 17:44:35 +0100 From: Arnd Bergmann To: Zhang Rui , Eduardo Valentin Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, spear-devel@list.st.com, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] thermal: allow spear-thermal driver to be a module Date: Mon, 25 Jan 2016 17:44:11 +0100 Message-Id: <1453740264-1972562-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453740264-1972562-1-git-send-email-arnd@arndb.de> References: <1453740264-1972562-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:slTMGtBECc0Jo+6KBNQ8omFcO8iGdy3Kr3Ra7DwWb/37R7dmBbg i5TxvRmmrEaNHKt69n+eg0ZEcUyWltc6O5w+lq2LYVnETBfqAmhDB34YlqHEmKcVeS9aMct auIgTKHDh5OHo6krDFoTAP9vyczTLJsh1R6hiH8E2YbA718WOSxY0TvfIIdWAqvDpk9wmTL uU2bTwpAO+HZCRiHnaqLA== X-UI-Out-Filterresults: notjunk:1; V01:K0:5rU2wQ5dh/w=:Nw3e3We0DZIGWtIgQgWiae SLyWg7WQUWf01Kxyqvvqyiz+AWWfz+Br1gzXhYOoFm8KeS/9n/3O2TIAwQcrNHvDrwn6pIJhC HBUDvY4sr4xhC+3dSq0gc6V+uODGYBEMe6z7tyVQXXsBkjo0cmKIhi/H6G/N2ywKHcmsdS/x5 bMOYflhPPD1JZPyppPrI6BhMUPyBqn6vqFtE44k3Ky/JqWOkmhJOFoQ1VnWURp2HKm8xo4m7p 4S+FaeGOTQ7uPD2+H/dHLB6n8hnlfUpyUXw+9eO4qx9ur5oGDwS9IgqKdqb0Pc2o4DXPkQWXJ n3Sb8dlt4GqbzEuCO6I4xbMbstIr4IGag3y/UuRiODvhz2Imwmvh40a7ZJUIhiaA1hKoE8p+3 +ko2CpvYK7NXdTbzY8M7vccaI0BSG0JVjYYsPICVTCsnCGGB+CgH58Rhg+MT28VfZDUJxgM/a MtX+BmWbzv5EAiKfHjz/0Xi9RqjtYr6vIMuA4/K57du5328Lyt1Han2VaYtQwsOJNJsEctbRj mMs/IszmYFkjxt7SVyrH+tIWdVTMFYd3AqVzmt60y9ktIgLrFfW+9EFjJKiBsqXa2I9gayCv5 PuZcVB21DmX3agqcCuZp0lGBifL1L3e2LRLwx0R2nMihFsVNDtE74wwLEjj8xYF/ckFYIXIuh R26U6foZSd6YCE1waPsoWXlVwdvE/r6qRLy1QDo57bJ+tFsEMxV3ZXTZWAdGhdNpl8D8= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the thermal subsystem is a loadable module, the spear driver fails to build: drivers/thermal/built-in.o: In function `spear_thermal_exit': spear_thermal.c:(.text+0xf8): undefined reference to `thermal_zone_device_unregister' drivers/thermal/built-in.o: In function `spear_thermal_probe': spear_thermal.c:(.text+0x230): undefined reference to `thermal_zone_device_register' This changes the symbol to a tristate, so Kconfig can track the dependency correctly. Signed-off-by: Arnd Bergmann --- drivers/thermal/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 8cc4ac64a91c..0852fd028dc9 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -195,7 +195,7 @@ config IMX_THERMAL passive trip is crossed. config SPEAR_THERMAL - bool "SPEAr thermal sensor driver" + tristate "SPEAr thermal sensor driver" depends on PLAT_SPEAR || COMPILE_TEST depends on OF help From patchwork Mon Jan 25 16:44:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101101 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1466773lbb; Mon, 25 Jan 2016 08:45:42 -0800 (PST) X-Received: by 10.98.74.135 with SMTP id c7mr26976060pfj.129.1453740342294; Mon, 25 Jan 2016 08:45:42 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yt3si34598846pab.60.2016.01.25.08.45.41; Mon, 25 Jan 2016 08:45:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933428AbcAYQpk (ORCPT + 30 others); Mon, 25 Jan 2016 11:45:40 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:64652 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752265AbcAYQpf (ORCPT ); Mon, 25 Jan 2016 11:45:35 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0MJawd-1aPgCR2xoJ-0031lS; Mon, 25 Jan 2016 17:44:56 +0100 From: Arnd Bergmann To: Zhang Rui , Eduardo Valentin Cc: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, spear-devel@list.st.com, Arnd Bergmann , Linus Walleij , Lee Jones , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module Date: Mon, 25 Jan 2016 17:44:12 +0100 Message-Id: <1453740264-1972562-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453740264-1972562-1-git-send-email-arnd@arndb.de> References: <1453740264-1972562-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:mTYUYNt8u7MeFw8oUkkRyfXipcfJR53qC97j2toD50QRnFI4r2W pDJRRERvz9458EtqVcvVX5UJNwhkQi0ZbjTwITJ5+1b3H/nezlldYJy9yrjy8WmQhUQpIz4 s6lrN9TSiuaGBDQVghwjOztd96as6LlE8fQ51t3Z3ZpDk6u743r4CVxH2n8C1qEA57+PG+V rcWoNLRY/R8l/11MSHj8Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:YtWnE1+t1+o=:SKJNliq6u96QevLM2B5oj1 0SV67JWuGIsnun8ZvLIOSXxtSZPVZ3GQXWAXbLnt8/bWE3Zx2+KkQ9vSXH3NXETcrkZoX6BOf gVkPz1w3tSXEM7Vee10ty1utlHu+ENWEV7wsh10kPeFtjFGaaXXjTqQdViZMm82lqtIIHcd8J Nx76/qBWfH2GoQ4GE+RmBBcby7ZO6L/lUjm/zIOUMb5jmYllgt1RbXdyEACgkMfhm9MuwU30d UVUZGbNF1KKDXaavLEgWBLkOtAucOwV53joYdnBUe+rBuKN+HldScwcwUpKeYaq5Jnzkmsx+k i6GPR/OEjHcdyMf+0iDaxE64OyYbin0uQEm/U7YTAzv4hScKU9ci7lN/lLOBs8109qclOzcEf Tz0WE4SR4v8/K46cA6kYPw6OkbqrcYFMx+J4IpZxIeJqurieUno9bCs4qdXREvwI/PWNWgWBQ c0FdvdQ8srfCb82sIC2L6BMkBQpIDnGTj289ODJYRnnvPTUlrFlHqs7lxGqYPjWV6Tx8CJPwj fKou1fLckJ2oAeW6So5ATTI/L7tcWkcRo6zxMTGepr5R7J6YXaq1YBAr7xIU9KN+C14WVuRGm ek/6K7H4XuOynBca515i71ggSt8ReqOfeAdhYUOSNn6GsGSbLpyzrUEcq1EV96NhVzhswGTYc 8u2wagZhz4Fk2LOL4+TY4q47Al/UccZTwRvqSPFtwxk3qXhnx7vm2pJC4MuznwL5ff6M= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the thermal subsystem is a loadable module, the u8500 driver fails to build: drivers/thermal/built-in.o: In function `db8500_thermal_probe': db8500_thermal.c:(.text+0x96c): undefined reference to `thermal_zone_device_register' drivers/thermal/built-in.o: In function `db8500_thermal_work': db8500_thermal.c:(.text+0xab4): undefined reference to `thermal_zone_device_update' This changes the symbol to a tristate, so Kconfig can track the dependency correctly. Signed-off-by: Arnd Bergmann --- drivers/mfd/db8500-prcmu.c | 3 +++ drivers/thermal/Kconfig | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) -- 2.7.0 Acked-by: Lee Jones Acked-by: Linus Walleij diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 2f4a1279b094..c0a86aeb1733 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2045,6 +2045,7 @@ int db8500_prcmu_config_hotmon(u8 low, u8 high) return 0; } +EXPORT_SYMBOL_GPL(db8500_prcmu_config_hotmon); static int config_hot_period(u16 val) { @@ -2071,11 +2072,13 @@ int db8500_prcmu_start_temp_sense(u16 cycles32k) return config_hot_period(cycles32k); } +EXPORT_SYMBOL_GPL(db8500_prcmu_start_temp_sense); int db8500_prcmu_stop_temp_sense(void) { return config_hot_period(0xFFFF); } +EXPORT_SYMBOL_GPL(db8500_prcmu_stop_temp_sense); static int prcmu_a9wdog(u8 cmd, u8 d0, u8 d1, u8 d2, u8 d3) { diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 0852fd028dc9..7c92c09be213 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -237,8 +237,8 @@ config DOVE_THERMAL framework. config DB8500_THERMAL - bool "DB8500 thermal management" - depends on ARCH_U8500 + tristate "DB8500 thermal management" + depends on MFD_DB8500_PRCMU default y help Adds DB8500 thermal management implementation according to the thermal