From patchwork Thu Nov 13 17:02:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5299351 X-Patchwork-Delegate: eduardo.valentin@ti.com 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE2CD9F2F1 for ; Thu, 13 Nov 2014 17:04:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE77C20219 for ; Thu, 13 Nov 2014 17:04:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16B97201FA for ; Thu, 13 Nov 2014 17:04:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754261AbaKMRDj (ORCPT ); Thu, 13 Nov 2014 12:03:39 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:50840 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754256AbaKMRDh (ORCPT ); Thu, 13 Nov 2014 12:03:37 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEZ00BRZM1ZR080@mailout3.samsung.com>; Fri, 14 Nov 2014 02:03:35 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-dc-5464e4673151 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 75.EF.09430.764E4645; Fri, 14 Nov 2014 02:03:35 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NEZ00JCWM0NNZ60@mmp2.samsung.com>; Fri, 14 Nov 2014 02:03:35 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Zhang Rui Cc: Ezequiel Garcia , Kuninori Morimoto , Linux PM list , Vincenzo Frascino , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Nobuhiro Iwamatsu , Mikko Perttunen , Stephen Warren , Thierry Reding , Alexandre Courbot , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [PATCH 6/8] thermal:cpu cooling:ti: Provide deferred probing for ti drivers Date: Thu, 13 Nov 2014 18:02:43 +0100 Message-id: <1415898165-27406-7-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1415898165-27406-1-git-send-email-l.majewski@samsung.com> References: <1411547232-21493-1-git-send-email-l.majewski@samsung.com> <1415898165-27406-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsVy+t9jQd30JykhBrcblSw2zljPajH/yjVW i9OnFrBanHv1iMXibXOxxavDuxgt3jzitnjzcDOjxeVdc9gsPvceYbTo/DKLzeLB1WlsFk8e 9rFZvDrYxmLxc9c8FotjJ2awOgh4PNl0kdFj56y77B6L97xk8lg37S2zx4HJ51g9epvfsXl8 OzORxaNvyypGj6c/9jJ7fN4k57FxbmgAdxSXTUpqTmZZapG+XQJXxs2Za1gKZnNWvF1yl7mB 8T57FyMnh4SAicSy+bcYIWwxiQv31rN1MXJxCAlMZ5Q42AeREBLoYpL4OcUGxGYT0JP4fPcp E4gtIuAt8XrfdEaQBmaB1ywSh340gE0VFgiT2LXjExuIzSKgKvHi9BqgIg4OXgE3iZktGRDL FCW6n00AK+EUcJc4euITO8TiZkaJz32zWCcw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpec n7uJERzmz6R3MK5qsDjEKMDBqMTD+4IlJUSINbGsuDL3EKMEB7OSCG/1faAQb0piZVVqUX58 UWlOavEhRmkOFiVx3oOt1oFCAumJJanZqakFqUUwWSYOTqkGxhWLTotsuL11m6f4Sp2YS7r1 Ua+NjOMlBP1Mt30rqE58nVntadlXFjsnz+pSoriFCsNfWVY2IyWe0v4v3MJ+6+Ms3dalzG5w 6ly10/iAr9C+N4s3lxjvfz+NjW/vjYMnLiaJNzOG2RtMsujie/107qZV6dk32esqr3ga2+Wp J3nX7NA7sF1UiaU4I9FQi7moOBEAnj2VqW8CAAA= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 When CPU freq is used as a thermal zone cooling device, one needs to wait until cpufreq subsystem is properly initialized. This code is similar to the one already available in imx_thermal.c file. Signed-off-by: Lukasz Majewski --- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index 634b6ce..0ac5ead 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "ti-bandgap.h" @@ -1196,6 +1197,12 @@ int ti_bandgap_probe(struct platform_device *pdev) struct ti_bandgap *bgp; int clk_rate, ret = 0, i; +#ifdef CONFIG_CPU_THERMAL + if (!cpufreq_get_current_driver()) { + dev_dbg(&pdev->dev, "no cpufreq driver!"); + return -EPROBE_DEFER; + } +#endif bgp = ti_bandgap_build(pdev); if (IS_ERR(bgp)) { dev_err(&pdev->dev, "failed to fetch platform data\n");