From patchwork Wed Dec 14 09:23:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5678 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 7919823E10 for ; Wed, 14 Dec 2011 09:24:24 +0000 (UTC) Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6A374A18300 for ; Wed, 14 Dec 2011 09:24:24 +0000 (UTC) Received: by mail-ee0-f52.google.com with SMTP id e52so590417eek.11 for ; Wed, 14 Dec 2011 01:24:24 -0800 (PST) Received: by 10.205.127.12 with SMTP id gy12mr385118bkc.108.1323854664212; Wed, 14 Dec 2011 01:24:24 -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 hg2cs2748bkc; Wed, 14 Dec 2011 01:24:24 -0800 (PST) Received: by 10.180.102.74 with SMTP id fm10mr3068999wib.26.1323854662828; Wed, 14 Dec 2011 01:24:22 -0800 (PST) Received: from DB3EHSOBE003.bigfish.com (db3ehsobe003.messaging.microsoft.com. [213.199.154.141]) by mx.google.com with ESMTPS id w7si1028770wec.8.2011.12.14.01.24.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Dec 2011 01:24:22 -0800 (PST) Received-SPF: neutral (google.com: 213.199.154.141 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=213.199.154.141; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.141 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail107-db3-R.bigfish.com (10.3.81.248) by DB3EHSOBE003.bigfish.com (10.3.84.23) with Microsoft SMTP Server id 14.1.225.23; Wed, 14 Dec 2011 09:24:24 +0000 Received: from mail107-db3 (localhost [127.0.0.1]) by mail107-db3-R.bigfish.com (Postfix) with ESMTP id 28FE9602E8; Wed, 14 Dec 2011 09:24:24 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) 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 mail107-db3 (localhost.localdomain [127.0.0.1]) by mail107-db3 (MessageSwitch) id 132385466485321_21289; Wed, 14 Dec 2011 09:24:24 +0000 (UTC) Received: from DB3EHSMHS008.bigfish.com (unknown [10.3.81.241]) by mail107-db3.bigfish.com (Postfix) with ESMTP id 0EC808009A; Wed, 14 Dec 2011 09:24:24 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS008.bigfish.com (10.3.87.108) with Microsoft SMTP Server (TLS) id 14.1.225.23; Wed, 14 Dec 2011 09:24:23 +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.355.3; Wed, 14 Dec 2011 03:24:09 -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 pBE9O2Pr004480; Wed, 14 Dec 2011 03:24:06 -0600 (CST) From: Richard Zhao To: CC: , , , , , , Subject: [RFC V2 1/8] clk: pass parent rate if recalc_rate is NULL Date: Wed, 14 Dec 2011 17:23:51 +0800 Message-ID: <1323854638-3455-2-git-send-email-richard.zhao@linaro.org> 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: 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 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;