Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966373AbbDQO06 (ORCPT ); Fri, 17 Apr 2015 10:26:58 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:28538 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964833AbbDQO04 (ORCPT ); Fri, 17 Apr 2015 10:26:56 -0400 From: Alban Bedel To: linux-mips@linux-mips.org Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Thomas Gleixner , Jason Cooper , Ralf Baechle , Alban Bedel , Andrew Bresticker , Qais Yousef , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/14] MIPS: ath79: Use the common clk API Date: Fri, 17 Apr 2015 16:24:23 +0200 Message-Id: <1429280669-2986-9-git-send-email-albeu@free.fr> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1429280669-2986-1-git-send-email-albeu@free.fr> References: <1429280669-2986-1-git-send-email-albeu@free.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2041 Lines: 87 Make the code simpler and open the way for device tree clocks. Signed-off-by: Alban Bedel --- arch/mips/Kconfig | 1 + arch/mips/ath79/clock.c | 29 ++--------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 1fa7f2f..a7b8ef4 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -120,6 +120,7 @@ config ATH79 select CSRC_R4K select DMA_NONCOHERENT select HAVE_CLK + select COMMON_CLK select CLKDEV_LOOKUP select IRQ_CPU select MIPS_MACHINE diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index 226ddf0..1fcb691 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -28,21 +29,15 @@ #define AR724X_BASE_FREQ 5000000 #define AR913X_BASE_FREQ 5000000 -struct clk { - unsigned long rate; -}; - static void __init ath79_add_sys_clkdev(const char *id, unsigned long rate) { struct clk *clk; int err; - clk = kzalloc(sizeof(*clk), GFP_KERNEL); + clk = clk_register_fixed_rate(NULL, id, NULL, CLK_IS_ROOT, rate); if (!clk) panic("failed to allocate %s clock structure", id); - clk->rate = rate; - err = clk_register_clkdev(clk, id, NULL); if (err) panic("unable to register %s clock device", id); @@ -468,23 +463,3 @@ ath79_get_sys_clk_rate(const char *id) return rate; } - -/* - * Linux clock API - */ -int clk_enable(struct clk *clk) -{ - return 0; -} -EXPORT_SYMBOL(clk_enable); - -void clk_disable(struct clk *clk) -{ -} -EXPORT_SYMBOL(clk_disable); - -unsigned long clk_get_rate(struct clk *clk) -{ - return clk->rate; -} -EXPORT_SYMBOL(clk_get_rate); -- 2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/