From patchwork Thu Jan 21 02:42:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 8077031 X-Patchwork-Delegate: horms@verge.net.au Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A7F229F1C0 for ; Thu, 21 Jan 2016 02:43:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0752D205E8 for ; Thu, 21 Jan 2016 02:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47364205E7 for ; Thu, 21 Jan 2016 02:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756461AbcAUCnk (ORCPT ); Wed, 20 Jan 2016 21:43:40 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:55438 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752662AbcAUCnM (ORCPT ); Wed, 20 Jan 2016 21:43:12 -0500 Received: from reginn.isobedori.kobe.vergenet.net (p5023-ipbfp803kobeminato.hyogo.ocn.ne.jp [123.221.39.23]) by kirsty.vergenet.net (Postfix) with ESMTPA id BBD9025B7CB; Thu, 21 Jan 2016 13:43:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1453344188; bh=+4cLMgklVTtY2EFKLER1z6EMMZvC79ZDT0Jbx7YqbkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=NZOps3Mo/1nkmsf+jKw3ktOANRkbMbzLQAqnR+LvCHqtxDoj1moL72OZzw0lcQq9B votKAJejP1bKPlDyr4lALaj8BGW8YJBHRFquwxeUh6VR+e9+PEYAF8Qk8Bc3V2RGht ttGjTRbNZ7xV46opSV353NTUSLCW/PwnBLVVyjj4= Received: by reginn.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 0047C94046F; Thu, 21 Jan 2016 11:43:07 +0900 (JST) From: Simon Horman To: Linus Torvalds Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Magnus Damm , Guenter Roeck , Geert Uytterhoeven , Simon Horman Subject: [PATCH 1/2] drivers: sh: clk: Remove obsolete and unused clk_round_parent() Date: Thu, 21 Jan 2016 11:42:51 +0900 Message-Id: <90069ad1b602d05740ed0fc5f72f09a616ceddd0.1453343708.git.horms+renesas@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Geert Uytterhoeven clk_round_parent() was only ever used by AP4EVB, until commit b24bd7e97b3784af ("ARM: shmobile: Remove AP4EVB board support"). The Common Clock Framework does not provide clk_round_parent(), hence remove it. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- drivers/sh/clk/core.c | 88 -------------------------------------------------- include/linux/sh_clk.h | 4 --- 2 files changed, 92 deletions(-) diff --git a/drivers/sh/clk/core.c b/drivers/sh/clk/core.c index be56b22ca941..6bf973bd9654 100644 --- a/drivers/sh/clk/core.c +++ b/drivers/sh/clk/core.c @@ -555,94 +555,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate) } EXPORT_SYMBOL_GPL(clk_round_rate); -long clk_round_parent(struct clk *clk, unsigned long target, - unsigned long *best_freq, unsigned long *parent_freq, - unsigned int div_min, unsigned int div_max) -{ - struct cpufreq_frequency_table *freq, *best = NULL; - unsigned long error = ULONG_MAX, freq_high, freq_low, div; - struct clk *parent = clk_get_parent(clk); - - if (!parent) { - *parent_freq = 0; - *best_freq = clk_round_rate(clk, target); - return abs(target - *best_freq); - } - - cpufreq_for_each_valid_entry(freq, parent->freq_table) { - if (unlikely(freq->frequency / target <= div_min - 1)) { - unsigned long freq_max; - - freq_max = (freq->frequency + div_min / 2) / div_min; - if (error > target - freq_max) { - error = target - freq_max; - best = freq; - if (best_freq) - *best_freq = freq_max; - } - - pr_debug("too low freq %u, error %lu\n", freq->frequency, - target - freq_max); - - if (!error) - break; - - continue; - } - - if (unlikely(freq->frequency / target >= div_max)) { - unsigned long freq_min; - - freq_min = (freq->frequency + div_max / 2) / div_max; - if (error > freq_min - target) { - error = freq_min - target; - best = freq; - if (best_freq) - *best_freq = freq_min; - } - - pr_debug("too high freq %u, error %lu\n", freq->frequency, - freq_min - target); - - if (!error) - break; - - continue; - } - - div = freq->frequency / target; - freq_high = freq->frequency / div; - freq_low = freq->frequency / (div + 1); - - if (freq_high - target < error) { - error = freq_high - target; - best = freq; - if (best_freq) - *best_freq = freq_high; - } - - if (target - freq_low < error) { - error = target - freq_low; - best = freq; - if (best_freq) - *best_freq = freq_low; - } - - pr_debug("%u / %lu = %lu, / %lu = %lu, best %lu, parent %u\n", - freq->frequency, div, freq_high, div + 1, freq_low, - *best_freq, best->frequency); - - if (!error) - break; - } - - if (parent_freq) - *parent_freq = best->frequency; - - return error; -} -EXPORT_SYMBOL_GPL(clk_round_parent); - #ifdef CONFIG_PM static void clks_core_resume(void) { diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 1f208b2a1ed6..645896b81244 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h @@ -113,10 +113,6 @@ long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, long clk_rate_mult_range_round(struct clk *clk, unsigned int mult_min, unsigned int mult_max, unsigned long rate); -long clk_round_parent(struct clk *clk, unsigned long target, - unsigned long *best_freq, unsigned long *parent_freq, - unsigned int div_min, unsigned int div_max); - #define SH_CLK_MSTP(_parent, _enable_reg, _enable_bit, _status_reg, _flags) \ { \ .parent = _parent, \