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: 36152 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 245672054F for ; Thu, 28 Aug 2014 05:53:10 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp18sf5735500obc.1 for ; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=erOz9C7LTMDNsu9caoi3B8ENDLWKorP+9IUvJfPBW3M=; b=AVCAbLZ/REwU8gwuFnPzvgVpePOKvoVvOWTKXOTRnvd/v+/dlIGHf+irK3H7pzJz4y XU+Eyb+W44rkAoOAg2ysxv7z+iMRcdIrng94aDAQl1xboeeo6ZVZ/XklLSzPwtyjC/tn x0Hfs59Wi0u5UgRvgCoPLBgXGb2wXwXuV0CVyP+/fkNOJRY9dSZ7nrh8sbZwg5fhZ2Km Y8B+20d0zis0UN4FjAFPTeDsT+QHpt1O2U3Lfd7Mw3M/IUyfT6Z5EjXYwENQp+NDeKzm qQ0ZuDvlKZp48QDLZE8j/jwdrOYsD5UH8oeS6Rm/SGQF1XvQ6AdUMipcUhJE3Y3jSSkr ODHQ== X-Gm-Message-State: ALoCoQlCMQVq6Zk0dKc9uySKoE5twQqD2nOWob80Cgj49TYCZaJbmUCcu+T9PeYzuCpP8aAFHIjZ X-Received: by 10.182.68.17 with SMTP id r17mr1060976obt.26.1409205189739; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.99 with SMTP id n90ls464812qge.66.gmail; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) X-Received: by 10.52.170.211 with SMTP id ao19mr1148677vdc.23.1409205189632; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id rk7si2805459vcb.45.2014.08.27.22.53.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 22:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lf12so298879vcb.20 for ; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) X-Received: by 10.52.228.67 with SMTP id sg3mr1249202vdc.6.1409205189556; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp184437vcb; Wed, 27 Aug 2014 22:53:09 -0700 (PDT) X-Received: by 10.68.94.226 with SMTP id df2mr2389387pbb.122.1409205188723; Wed, 27 Aug 2014 22:53:08 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz2si4047100pbc.237.2014.08.27.22.53.08 for ; Wed, 27 Aug 2014 22:53:08 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934097AbaH1FxH (ORCPT + 15 others); Thu, 28 Aug 2014 01:53:07 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:47019 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933992AbaH1FxG (ORCPT ); Thu, 28 Aug 2014 01:53:06 -0400 Received: by mail-pa0-f54.google.com with SMTP id fb1so1123069pad.27 for ; Wed, 27 Aug 2014 22:53:05 -0700 (PDT) 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-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }