From patchwork Fri Jan 8 20:06:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 7989901 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 062F39F6CD for ; Fri, 8 Jan 2016 20:07:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BEA7201B9 for ; Fri, 8 Jan 2016 20:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4A304200E6 for ; Fri, 8 Jan 2016 20:07:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213AbcAHUHW (ORCPT ); Fri, 8 Jan 2016 15:07:22 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:62934 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbcAHUHU (ORCPT ); Fri, 8 Jan 2016 15:07:20 -0500 Received: from wuerfel.localnet ([134.3.118.24]) by mrelayeu.kundenserver.de (mreue001) with ESMTPSA (Nemesis) id 0MLnvv-1aISO52vg3-000qYZ; Fri, 08 Jan 2016 21:06:46 +0100 From: Arnd Bergmann To: broonie@kernel.org Cc: Liam Girdwood , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency Date: Fri, 08 Jan 2016 21:06:43 +0100 Message-ID: <7607130.s0M7SSqlJV@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:8m/z+ZcuBFC9XQ8nxdz8xM4eTRlurJjY9dO7FrF5OGxSw6oQZqH 1bamdH3YimOp/n29byQ0pFBj1Qirg7CyuHjKka+9qOjRe3f0Kp6sIQc4vkzeHjFUW4d86mz jyJTWo17ZkpIb/dIK624vPU4iqNnZ/A3cLr5Vz8R9lVU9emuhQrL56JcmlZNpzLze26OebL GtjuB8Fhm2ek6rTa2xypA== X-UI-Out-Filterresults: notjunk:1; V01:K0:rxPMDhsIn+I=:xYp5d4oBXMMr2B6z8N8j6f P6qkprNemPD0ZsoCCXv5iZJntzL/0YNdIZp4v00vV4LW+oyEIZW/DQ6ogAZ4oH5W0RyqibjQh WleMj5IvcTzyCcEbbpjBKfBjL71sw82KeCkGH3i47h3RogFRvYy220caEut48xs89LpZ0c0De RjkzKMzkS49ugPMNC6QuniApkmQatO+62LN4w1WazZ8gNxge/qJxH7aiJM0R2So+b/44in/wz tTcw/vFyzv+RIe+Y18EElpunX9aXtgsGjOLVWcCtyK3r/M5+XdbF31L1Bdf7IuwYcZCTj/C28 V3I6gpuJMiXsQxFmZ6drGpIynPSqLc4G3Ki+cGkBs54kWDMx9IrjoRQDBpj7y2EDS9teNlMwT frxMdqb06qreF/bEvVUQ14JxbQpRdbL4WMIBRdMDDokPswX21I0NbigAxBLBSEUWxRHwhALIt Nof/dQ/Sp95lCBfbHhI58SJlEucrqyPWNglI+6YBfqJiI0UVmboK/RLryxRVXTuEasogUQPgI owgKlrDe8cU53CrupGXxQ0oaGcbAI9kzmIwzrgwFGFxhCGuVr7vCPZjpvidy/TUtmHBVqgyRb snPv0iA4MxEw/4wFFceFuxfhCY5YskalX8ZG5vyO1O4qLj6/exWbwDGjstUlCMupz7WWXzQf0 XVZD0iuIOT2NutUMXkY1w1j8Ms4Y8kG4NL9YVXh/pcm8BXNd/2/LmVAwqrptFNh6uyS2DA+mW TBif+lmbalHYLWJF Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 9f5ddfc667eb45dc2c5459e5acc5de45572456cd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 8 Jan 2016 20:59:29 +0100 Subject: [PATCH] regulator: max8973: add THERMAL_OF dependency The max8973 regulator driver has gained thermal support, but it now fails to link when the driver is built-in and CONFIG_THERMAL=m: drivers/built-in.o: In function `max8973_remove': console.c:(.text+0x94ac4): undefined reference to `thermal_zone_of_sensor_unregister' drivers/built-in.o: In function `max8973_probe': console.c:(.text+0x95710): undefined reference to `thermal_zone_of_sensor_register' This adds a dependency "depends on THERMAL || !THERMAL_OF" to ensure that the driver cannot be built-in when THERMAL=m but is forced to be a module as well, unless THERMAL_OF is disabled. Signed-off-by: Arnd Bergmann Fixes: 1b7a4c6a9eea ("regulator: max8973: add support for junction thermal warning") --- I've run into the same problem a couple of times now, with every driver that calls thermal_zone_of_sensor_register(). I think we need a better solution in general, but this fixes the immediate build error for now. Maybe we should replace the "#ifdef CONFIG_THERMAL_OF" with "#if IS_REACHABLE(CONFIG_THERMAL) && IS_ENABLED(CONFIG_THERMAL_OF)"? The disadvantage of that is that the thermal management would be silently disabled rather than cause a link error, and that may also not be desired. -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 8155e80dd3f8..7df9da82f592 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -383,6 +383,7 @@ config REGULATOR_MAX8952 config REGULATOR_MAX8973 tristate "Maxim MAX8973 voltage regulator " depends on I2C + depends on THERMAL || !THERMAL_OF select REGMAP_I2C help The MAXIM MAX8973 high-efficiency. three phase, DC-DC step-down