From patchwork Wed Oct 24 11:58:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 1637901 Return-Path: X-Original-To: patchwork-linux-pm@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 910D4DF238 for ; Wed, 24 Oct 2012 12:00:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758315Ab2JXL7L (ORCPT ); Wed, 24 Oct 2012 07:59:11 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:36607 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758306Ab2JXL7I (ORCPT ); Wed, 24 Oct 2012 07:59:08 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so1164381pbb.19 for ; Wed, 24 Oct 2012 04:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YPHTf7kzts8n0Ipvo0gW5BpY1lBwsjCmUvO+aZX1/b0=; b=HarkrGCm648JBJSaf+FTEHGGrzf+lY0vt3+GyztX7im/EEVjAgezbefp1Vo83Q3Wj7 folgEPwQyl3wHcxcRORrwyudGBEmfctUynZzEieDD+EWeUCkrze9V+JFm4SEY3Qdx8sp +SDTzlue0lnlu1DfCS6R8h8JpXeyst90mqr+LpyWzTRGTt02pxCFeizf7cJG6H66e7Hn JkoiFZCYCZeChyfXneaPK4mXYLJ17EglxJPXhuMdYmdjljz26gFs0IDcwNhN67ZccnLJ x8JnTJhPyasb1H1L0EMG/9IIboHrFvLcxMsdFDq/E4SIi4WHaxAWWqtMu/pzp7WF2jdp S8aA== Received: by 10.66.90.65 with SMTP id bu1mr43559002pab.31.1351079947775; Wed, 24 Oct 2012 04:59:07 -0700 (PDT) Received: from stebjsxu0148.bjs.st.com ([124.127.135.94]) by mx.google.com with ESMTPS id nm2sm9357200pbc.43.2012.10.24.04.59.01 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 04:59:07 -0700 (PDT) From: "hongbo.zhang" To: linaro-dev@lists.linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: patches@linaro.org, linaro-kernel@lists.linaro.org, STEricsson_nomadik_linux@list.st.com, kernel@igloocommunity.org, "hongbo.zhang" Subject: [PATCH V2 2/6] Thermal: make sure cpufreq cooling register after cpufreq driver Date: Wed, 24 Oct 2012 19:58:16 +0800 Message-Id: <1351079900-32236-3-git-send-email-hongbo.zhang@linaro.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1351079900-32236-1-git-send-email-hongbo.zhang@linaro.com> References: <1350387889-15324-1-git-send-email-hongbo.zhang@linaro.com> <1351079900-32236-1-git-send-email-hongbo.zhang@linaro.com> X-Gm-Message-State: ALoCoQnkZIAwajle28Bh9WC+KYKiGMHZMAdc9xrOyoAH6Xu456gQfdDhpjKIZsUiGXK6CM4XXzXl Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: "hongbo.zhang" The cpufreq works as a cooling device, so the cooling layer should check if the cpufreq driver is initialized or not. Signed-off-by: hongbo.zhang --- drivers/thermal/cpu_cooling.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index b6b4c2a..7519a0b 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -354,6 +354,10 @@ struct thermal_cooling_device *cpufreq_cooling_register( int ret = 0, i; struct cpufreq_policy policy; + /* make sure cpufreq driver has been initialized */ + if (!cpufreq_frequency_get_table(cpumask_any(clip_cpus))) + return ERR_PTR(-EPROBE_DEFER); + list_for_each_entry(cpufreq_dev, &cooling_cpufreq_list, node) cpufreq_dev_count++;