From patchwork Sat Nov 10 06:43:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 1723261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 101A4DF230 for ; Sat, 10 Nov 2012 06:47:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TX4p5-0004q2-Qu; Sat, 10 Nov 2012 06:45:44 +0000 Received: from mail-pa0-f49.google.com ([209.85.220.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TX4o5-0004KP-Nt for linux-arm-kernel@lists.infradead.org; Sat, 10 Nov 2012 06:44:42 +0000 Received: by mail-pa0-f49.google.com with SMTP id bi5so3012955pad.36 for ; Fri, 09 Nov 2012 22:44:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references:x-gm-message-state; bh=w0qHyp+frcsTJ6M4R1zhWLWyOSC/y1dBPrU6wT45Mhg=; b=PPaT2rXC8P4SADIdD3eMOCFfpYCyWMUA8gkfOwhGR1XiDyvXEjr5zV83o4nxhGfKub fImUQKxH/d6wh3IoGlKuqn0izPki4dKUJB3fIvAIvjzfxz91D99FhQtpIcMMc/SP4F3l /f/m8wKr21r+8A0W7s2P38Di1FYv6zMYdn6He76hUYB75JP40x6bT+rktcQMpqQwuZrD FCSSCXI76KJnvVwkbIp7BpuBihi+4uhlM3jQumo6NtlHuidbfyYpVCfvi10rvDs+ZMWR T464N7kGxKIdeq4h/jkmy1U2Thu/UhOlDZyp4uEZbBo/T9jNnAZj1VxjvIq/fO4opRcG 5Q9g== Received: by 10.69.1.9 with SMTP id bc9mr40091144pbd.61.1352529881473; Fri, 09 Nov 2012 22:44:41 -0800 (PST) Received: from localhost ([122.172.201.53]) by mx.google.com with ESMTPS id sg7sm512644pbb.50.2012.11.09.22.44.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 22:44:41 -0800 (PST) From: Viresh Kumar To: mike.turquette@linaro.org Subject: [PATCH 7/8] CLK: SPEAr: Correct index scanning done for clock synths Date: Sat, 10 Nov 2012 12:13:46 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQlWmQ1q36/IZAtoAQHrywhLLexlaGIYvhGTJETrCDT/7gWNoQkZ3tw9F6Y9y1Z5QManHl/E X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121110_014442_003691_A65BAB82 X-CRM114-Status: GOOD ( 10.55 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Viresh Kumar , spear-devel@list.st.com, linux-arm-kernel@lists.infradead.org, Deepak Sikri X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Deepak Sikri The patch corrects the case when the rate table is being scanned for a given frequency, and the search frequency is beyond the maximum frequency indexed in the table. By default, the system should be set at max frequency present in the rate table. This patch correctly returns the corresponding index value. Signed-off-by: Deepak Sikri Signed-off-by: Viresh Kumar --- drivers/clk/spear/clk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/spear/clk.c b/drivers/clk/spear/clk.c index 7cd6378..628b6d5 100644 --- a/drivers/clk/spear/clk.c +++ b/drivers/clk/spear/clk.c @@ -32,5 +32,8 @@ long clk_round_rate_index(struct clk_hw *hw, unsigned long drate, } } + if ((*index) == rtbl_cnt) + (*index)--; + return rate; }