From patchwork Tue Oct 14 05:12:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bai Ping X-Patchwork-Id: 5077951 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97C23C11AC for ; Tue, 14 Oct 2014 06:17:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C50E320148 for ; Tue, 14 Oct 2014 06:17:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FDBA200DF for ; Tue, 14 Oct 2014 06:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754500AbaJNGRU (ORCPT ); Tue, 14 Oct 2014 02:17:20 -0400 Received: from mail-bn1bbn0102.outbound.protection.outlook.com ([157.56.111.102]:7466 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754323AbaJNGRT (ORCPT ); Tue, 14 Oct 2014 02:17:19 -0400 Received: from BN1PR0301MB0625.namprd03.prod.outlook.com (25.160.170.28) by BN1PR0301MB0722.namprd03.prod.outlook.com (25.160.78.141) with Microsoft SMTP Server (TLS) id 15.0.1049.19; Tue, 14 Oct 2014 06:17:17 +0000 Received: from BN3PR0301CA0013.namprd03.prod.outlook.com (25.160.180.151) by BN1PR0301MB0625.namprd03.prod.outlook.com (25.160.170.28) with Microsoft SMTP Server (TLS) id 15.0.1049.19; Tue, 14 Oct 2014 06:17:16 +0000 Received: from BN1AFFO11FD047.protection.gbl (2a01:111:f400:7c10::185) by BN3PR0301CA0013.outlook.office365.com (2a01:111:e400:4000::23) with Microsoft SMTP Server (TLS) id 15.0.1049.19 via Frontend Transport; Tue, 14 Oct 2014 06:17:16 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Tue, 14 Oct 2014 06:17:16 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s9E6HBYT011787; Mon, 13 Oct 2014 23:17:12 -0700 From: Bai Ping To: , CC: Subject: [PATCH v2] thermal: imx: correct driver load sequence for cpu cooling Date: Tue, 14 Oct 2014 13:12:07 +0800 Message-ID: <1413263527-31102-1-git-send-email-B51503@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(19580405001)(81156004)(50466002)(44976005)(69596002)(68736004)(105606002)(87936001)(229853001)(88136002)(107046002)(6806004)(19580395003)(85852003)(87286001)(104166001)(48376002)(95666004)(93916002)(99396003)(50986999)(106466001)(89996001)(92726001)(92566001)(84676001)(26826002)(31966008)(102836001)(104016003)(47776003)(20776003)(64706001)(97736003)(85306004)(76482002)(50226001)(62966002)(77156001)(4396001)(80022003)(46102003)(120916001)(21056001)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN1PR0301MB0625; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:;UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0625; X-Forefront-PRVS: 03648EFF89 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Ping.Bai@freescale.com; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN1PR0301MB0722; X-OriginatorOrg: freescale.com 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, T_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: Bai Ping thermal driver should be regisetered after cpufreq driver has been registered and probed. Doing so is to make sure that thermal driver can get the max cpu cooling states correctly when calling get_property. Signed-off-by: Bai Ping --- Changes for v2 -Address the comments from Eduardo Valentin drivers/thermal/imx_thermal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 2c516f2..8697caf 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -406,6 +406,10 @@ static int imx_thermal_probe(struct platform_device *pdev) int measure_freq; int ret; + if (!cpufreq_get_current_driver()) { + dev_dbg(&pdev->dev, "no cpufreq driver!"); + return -EPROBE_DEFER; + } data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM;