MIPS: JZ4740: replace use of jz4740_clock_bdata

Replace uses of the jz4740_clock_bdata struct with calls to clk_get_rate
for the appropriate clock. This is in preparation for migrating the
clocks towards common clock framework & devicetree.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-mips@linux-mips.org
Cc: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com>
Cc: linux-kernel@vger.kernel.org
Cc: Apelete Seketeli <apelete@seketeli.net>
Patchwork: https://patchwork.linux-mips.org/patch/10149/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Paul Burton
2015-05-24 16:11:33 +01:00
committed by Ralf Baechle
parent 1f4b840983
commit e06b86a33a
3 changed files with 29 additions and 4 deletions

View File

@@ -13,6 +13,7 @@
*
*/
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
@@ -308,9 +309,17 @@ static struct platform_device jz4740_uart_device = {
void jz4740_serial_device_register(void)
{
struct plat_serial8250_port *p;
struct clk *ext_clk;
unsigned long ext_rate;
ext_clk = clk_get(NULL, "ext");
if (IS_ERR(ext_clk))
panic("unable to get ext clock");
ext_rate = clk_get_rate(ext_clk);
clk_put(ext_clk);
for (p = jz4740_uart_data; p->flags != 0; ++p)
p->uartclk = jz4740_clock_bdata.ext_rate;
p->uartclk = ext_rate;
platform_device_register(&jz4740_uart_device);
}