From patchwork Wed Nov 23 11:12:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5290 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4DF4023E07 for ; Wed, 23 Nov 2011 11:13:27 +0000 (UTC) Received: from mail-gx0-f180.google.com (mail-gx0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1DE45A1866C for ; Wed, 23 Nov 2011 11:13:27 +0000 (UTC) Received: by mail-gx0-f180.google.com with SMTP id v5so1710751ggn.11 for ; Wed, 23 Nov 2011 03:13:26 -0800 (PST) Received: by 10.152.111.170 with SMTP id ij10mr11076523lab.5.1322046806594; Wed, 23 Nov 2011 03:13:26 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs225893lal; Wed, 23 Nov 2011 03:13:26 -0800 (PST) Received: by 10.68.57.33 with SMTP id f1mr7147392pbq.104.1322046803962; Wed, 23 Nov 2011 03:13:23 -0800 (PST) Received: from VA3EHSOBE003.bigfish.com (va3ehsobe003.messaging.microsoft.com. [216.32.180.13]) by mx.google.com with ESMTPS id j6si3072732pbh.140.2011.11.23.03.13.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Nov 2011 03:13:23 -0800 (PST) Received-SPF: neutral (google.com: 216.32.180.13 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=216.32.180.13; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.13 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail14-va3-R.bigfish.com (10.7.14.254) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 14.1.225.22; Wed, 23 Nov 2011 11:12:41 +0000 Received: from mail14-va3 (localhost [127.0.0.1]) by mail14-va3-R.bigfish.com (Postfix) with ESMTP id 09F778016D; Wed, 23 Nov 2011 11:10:55 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail14-va3 (localhost.localdomain [127.0.0.1]) by mail14-va3 (MessageSwitch) id 1322046654515019_21651; Wed, 23 Nov 2011 11:10:54 +0000 (UTC) Received: from VA3EHSMHS021.bigfish.com (unknown [10.7.14.238]) by mail14-va3.bigfish.com (Postfix) with ESMTP id 759372C0046; Wed, 23 Nov 2011 11:10:54 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS021.bigfish.com (10.7.99.31) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 23 Nov 2011 11:12:40 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.339.2; Wed, 23 Nov 2011 05:13:20 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pANBDAMh008802; Wed, 23 Nov 2011 05:13:17 -0600 (CST) From: Richard Zhao To: CC: , , , , , , Subject: [RFC V1 2/8] clk: pass parent rate if recalc_rate is NULL Date: Wed, 23 Nov 2011 19:12:29 +0800 Message-ID: <1322046755-13511-3-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322046755-13511-1-git-send-email-richard.zhao@linaro.org> References: <1322046755-13511-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Signed-off-by: Richard Zhao --- drivers/clk/clk.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ed557c9..2d8422f 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -256,6 +256,8 @@ static void clk_recalc_rates(struct clk *clk) if (clk->ops->recalc_rate) clk->rate = clk->ops->recalc_rate(clk); + else if (clk->parent) + clk->rate = clk->parent->rate; if (old_rate == clk->rate) return; @@ -527,6 +529,8 @@ void clk_init(struct device *dev, struct clk *clk) if (clk->ops->recalc_rate) clk->rate = clk->ops->recalc_rate(clk); + else if (clk->parent) + clk->rate = clk->parent->rate; else clk->rate = 0;