From patchwork Thu Aug 28 05:52:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 4792731 Return-Path: X-Original-To: patchwork-linux-arm-msm@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 5B3BB9F666 for ; Thu, 28 Aug 2014 05:53:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80F802015E for ; Thu, 28 Aug 2014 05:53:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA54F2016C for ; Thu, 28 Aug 2014 05:53:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934113AbaH1FxH (ORCPT ); Thu, 28 Aug 2014 01:53:07 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:57482 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934070AbaH1FxG (ORCPT ); Thu, 28 Aug 2014 01:53:06 -0400 Received: by mail-pa0-f54.google.com with SMTP id fb1so1131898pad.13 for ; Wed, 27 Aug 2014 22:53:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=xPCBarEpbeTz3AJL/r2Shu8pKoOkXp7AV5A/7nBVWh8=; b=VhVtG3ieoDBP5PaFyJRbxy9VIhhM+VB4D7ymJenR1cbbh4JqKxt3zKN5TyA4cgHe5y B65S/JYfiv/4tVPEoKUSbumm9dELtQtsL1VnVu7AUYYYgaOGDrYUtzqChjqzh+MbbXwi 2DHu52CfyDofksG0/X9UFAeO0ISJGOveD2uyo3H48knnhOyDEvG/fKwm/WlOZQqUlYLk 7mtucJ9th5PT84W7YENCftu2gB0pixNsAx/an00NzYWFV8WAznNFYJwO45MrqcYci0x/ 3ACLKy242b79CiU1jODC8pL/G1+PvgVG0WrdqZp8DCqIxipwrD9dtCvmRngyD111x6cv GGFA== X-Gm-Message-State: ALoCoQmfIFmogR43wh+sGdF14QaEjnwmfTAMauDQtxWAsUpacngkkgpW8PKDa3+TYN7BcqfJI20t X-Received: by 10.70.133.136 with SMTP id pc8mr2566434pdb.0.1409205185650; Wed, 27 Aug 2014 22:53:05 -0700 (PDT) Received: from localhost ([122.167.123.172]) by mx.google.com with ESMTPSA id ur5sm8891656pac.46.2014.08.27.22.53.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Aug 2014 22:53:05 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, shawn.guo@linaro.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, spk.linux@gmail.com, thomas.ab@samsung.com, t.figa@samsung.com, santosh.shilimkar@ti.com, thomas.petazzoni@free-electrons.com, pramod.gurav@smartplayin.com, Viresh Kumar Subject: [PATCH V3 04/10] cpufreq: cpu0: print relevant error when we defer probe Date: Thu, 28 Aug 2014 11:22:26 +0530 Message-Id: X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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 Currently, we defer probe if regulator_get() returned -EPROBE_DEFER, i.e. regulator isn't registered yet. We do a dev_err() in this case. Sending a message to the log on probe defer just duplicates what the driver core is already doing. Convert it to dev_dbg() instead. We should defer in case of clk_get() as well. Current code already does it, but it wasn't intentional probably. Its just that we are returning the right error with wrong print message. Fix print message to convey right error. Tested-by: Stephen Boyd Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-cpu0.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index d2dc921..eb07e3f 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -151,7 +151,16 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) cpu_clk = clk_get(cpu_dev, NULL); if (IS_ERR(cpu_clk)) { ret = PTR_ERR(cpu_clk); - pr_err("failed to get cpu0 clock: %d\n", ret); + + /* + * If cpu's clk node is present, but clock is not yet + * registered, we should try defering probe. + */ + if (ret == -EPROBE_DEFER) + dev_dbg(cpu_dev, "cpu0 clock not ready, retry\n"); + else + dev_err(cpu_dev, "failed to get cpu0 clock: %d\n", ret); + goto out_put_reg; }