Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754683AbaGBFzk (ORCPT ); Wed, 2 Jul 2014 01:55:40 -0400 Received: from mail-oa0-f49.google.com ([209.85.219.49]:46822 "EHLO mail-oa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753941AbaGBFzi (ORCPT ); Wed, 2 Jul 2014 01:55:38 -0400 MIME-Version: 1.0 In-Reply-To: <20140702055330.GA3454@dragon> References: <20140702055330.GA3454@dragon> Date: Wed, 2 Jul 2014 11:25:38 +0530 Message-ID: Subject: Re: [PATCH 06/14] cpufreq: cpu0: defer probe if clock isn't registered yet From: Viresh Kumar To: Shawn Guo Cc: "Rafael J. Wysocki" , Lists linaro-kernel , "linux-pm@vger.kernel.org" , Linux Kernel Mailing List , Arvind Chauhan , Stephen Boyd , linux-arm-msm@vger.kernel.org, Sachin Kamat , Thomas P Abraham , Nishanth Menon , Tomasz Figa Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2 July 2014 11:23, Shawn Guo wrote: > On Tue, Jul 01, 2014 at 10:02:35PM +0530, Viresh Kumar wrote: >> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c >> index 4273a5f..b5b8e1c 100644 >> --- a/drivers/cpufreq/cpufreq-cpu0.c >> +++ b/drivers/cpufreq/cpufreq-cpu0.c >> @@ -150,8 +150,17 @@ 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); > > If you keep this ... > >> - 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 (PTR_ERR(cpu_clk) == -EPROBE_DEFER) { > > ... you can use 'ret' here ... > >> + dev_err(cpu_dev, "cpu0 clock not ready, retry\n"); >> + ret = -EPROBE_DEFER; > > ... this can be saved ... > >> + } else { >> + ret = PTR_ERR(cpu_clk); > > ... and this as well. All accepted. Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/