From patchwork Thu Dec 15 01:30:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5741 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 12CAC23E04 for ; Thu, 15 Dec 2011 01:31:00 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 05611A1811B for ; Thu, 15 Dec 2011 01:31:00 +0000 (UTC) Received: by eaak10 with SMTP id k10so1524152eaa.11 for ; Wed, 14 Dec 2011 17:30:59 -0800 (PST) Received: by 10.204.156.208 with SMTP id y16mr235371bkw.72.1323912659783; Wed, 14 Dec 2011 17:30:59 -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.205.129.2 with SMTP id hg2cs25849bkc; Wed, 14 Dec 2011 17:30:59 -0800 (PST) Received: by 10.180.109.106 with SMTP id hr10mr1319555wib.62.1323912658300; Wed, 14 Dec 2011 17:30:58 -0800 (PST) Received: from DB3EHSOBE001.bigfish.com (db3ehsobe001.messaging.microsoft.com. [213.199.154.139]) by mx.google.com with ESMTPS id x5si2712738wiw.71.2011.12.14.17.30.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 17:30:58 -0800 (PST) Received-SPF: neutral (google.com: 213.199.154.139 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) client-ip=213.199.154.139; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.139 is neither permitted nor denied by best guess record for domain of B20223@freescale.com) smtp.mail=B20223@freescale.com Received: from mail38-db3-R.bigfish.com (10.3.81.249) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 14.1.225.23; Thu, 15 Dec 2011 01:30:58 +0000 Received: from mail38-db3 (localhost [127.0.0.1]) by mail38-db3-R.bigfish.com (Postfix) with ESMTP id 7A48F30014B; Thu, 15 Dec 2011 01:31:01 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh2a8h668h839h) 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-SS: 13, Received: from mail38-db3 (localhost.localdomain [127.0.0.1]) by mail38-db3 (MessageSwitch) id 1323912661422310_5200; Thu, 15 Dec 2011 01:31:01 +0000 (UTC) Received: from DB3EHSMHS007.bigfish.com (unknown [10.3.81.240]) by mail38-db3.bigfish.com (Postfix) with ESMTP id 621A8700043; Thu, 15 Dec 2011 01:31:01 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS007.bigfish.com (10.3.87.107) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 15 Dec 2011 01:30:57 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.355.3; Wed, 14 Dec 2011 19:30:53 -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 pBF1UpWP022288; Wed, 14 Dec 2011 19:30:51 -0600 (CST) From: Richard Zhao To: CC: , Richard Zhao , Richard Zhao Subject: [RFC V2 1/8] clk: pass parent rate if recalc_rate is NULL Date: Thu, 15 Dec 2011 09:30:48 +0800 Message-ID: <1323912648-21251-1-git-send-email-richard.zhao@freescale.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323854638-3455-1-git-send-email-richard.zhao@linaro.org> References: <1323854638-3455-1-git-send-email-richard.zhao@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: freescale.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 a6ddbb1..30ba22e 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -470,6 +470,8 @@ static void __clk_recalc_rates(struct clk *clk, unsigned long msg) if (clk->ops->recalc_rate) clk->rate = clk->ops->recalc_rate(clk); + else if (clk->parent) + clk->rate = clk->parent->rate; /* ignore return value for POST_RATE_CHANGE & ABORT_RATE_CHANGE */ if (clk->notifier_count) @@ -864,6 +866,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;