From patchwork Wed Nov 14 15:23:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 1741961 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 606E2DF264 for ; Wed, 14 Nov 2012 15:24:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422632Ab2KNPYE (ORCPT ); Wed, 14 Nov 2012 10:24:04 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:49377 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161133Ab2KNPYB (ORCPT ); Wed, 14 Nov 2012 10:24:01 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAEFNvvB008939; Wed, 14 Nov 2012 09:23:57 -0600 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAEFNv9J009996; Wed, 14 Nov 2012 09:23:57 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 14 Nov 2012 09:23:57 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAEFNvM0006630; Wed, 14 Nov 2012 09:23:57 -0600 Received: from localhost (h64-12.vpn.ti.com [172.24.64.12]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id qAEFNnw22372; Wed, 14 Nov 2012 09:23:50 -0600 (CST) From: Eduardo Valentin To: CC: , , , , Eduardo Valentin Subject: [PATCH 1/1] thermal: cpu cooling: allow module builds Date: Wed, 14 Nov 2012 11:23:30 -0400 Message-ID: <1352906610-549-1-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org As thermal drivers can be built as modules and also the thermal framework itself, building cpu cooling only as built-in can cause linking errors. For instance: * Generic Thermal sysfs driver * Generic Thermal sysfs driver (THERMAL) [M/n/y/?] m generic cpu cooling support (CPU_THERMAL) [N/y/?] (NEW) y with the following drive: CONFIG_OMAP_BANDGAP=m generates: ERROR: "cpufreq_cooling_unregister" [drivers/staging/omap-thermal/omap-thermal.ko] undefined! ERROR: "cpufreq_cooling_register" [drivers/staging/omap-thermal/omap-thermal.ko] undefined! This patch changes cpu cooling driver to allow it to be built as module. Reported-by: Enric Balletbo i Serra Signed-off-by: Eduardo Valentin Reviewed-by: Durgadoss R --- drivers/thermal/Kconfig | 2 +- include/linux/cpu_cooling.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index e1cb6bd..3b03c8b 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -20,7 +20,7 @@ config THERMAL_HWMON default y config CPU_THERMAL - bool "generic cpu cooling support" + tristate "generic cpu cooling support" depends on THERMAL && CPU_FREQ select CPU_FREQ_TABLE help diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index b30cc79c..40b4ef5 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -29,7 +29,7 @@ #define CPUFREQ_COOLING_START 0 #define CPUFREQ_COOLING_STOP 1 -#ifdef CONFIG_CPU_THERMAL +#if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE) /** * cpufreq_cooling_register - function to create cpufreq cooling device. * @clip_cpus: cpumask of cpus where the frequency constraints will happen