diff options
author | Manjunathappa, Prakash <prakash.pm@ti.com> | 2013-06-19 14:45:42 +0530 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2013-08-22 00:38:59 +0530 |
commit | 323761bb7518d27c62c1514156cb3243930b55c1 (patch) | |
tree | c4c9257fe6746e21ec595047a9840a3ba86e0be3 /arch/arm/mach-davinci/serial.c | |
parent | fcf7157ba3b50e57653544421250ebbe81a33d81 (diff) | |
download | op-kernel-dev-323761bb7518d27c62c1514156cb3243930b55c1.zip op-kernel-dev-323761bb7518d27c62c1514156cb3243930b55c1.tar.gz |
ARM: davinci: serial: remove davinci_serial_setup_clk()
Get rid of davinci_serial_setup_clk() since its not called
from multiple places now. Instead initialize clock in
davinci_serial_init() itself. This also helps get rid of
"serial_dev" member of struct davinci_soc_info.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
Suggested-by: Sekhar Nori <nsekhar@ti.com>
[nsekhar@ti.com: split removal of davinci_serial_setup_clk()
into a separate patch.]
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci/serial.c')
-rw-r--r-- | arch/arm/mach-davinci/serial.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/arch/arm/mach-davinci/serial.c b/arch/arm/mach-davinci/serial.c index 45bd41a..5e93a73 100644 --- a/arch/arm/mach-davinci/serial.c +++ b/arch/arm/mach-davinci/serial.c @@ -70,33 +70,12 @@ static void __init davinci_serial_reset(struct plat_serial8250_port *p) UART_DM646X_SCR_TX_WATERMARK); } -/* Enable UART clock and obtain its rate */ -int __init davinci_serial_setup_clk(unsigned instance, unsigned int *rate) -{ - struct clk *clk; - struct davinci_soc_info *soc_info = &davinci_soc_info; - struct device *dev = &soc_info->serial_dev[instance].dev; - - clk = clk_get(dev, NULL); - if (IS_ERR(clk)) { - pr_err("%s:%d: failed to get UART%d clock\n", - __func__, __LINE__, instance); - return PTR_ERR(clk); - } - - clk_prepare_enable(clk); - - if (rate) - *rate = clk_get_rate(clk); - - return 0; -} - int __init davinci_serial_init(struct platform_device *serial_dev) { int i, ret = 0; struct device *dev; struct plat_serial8250_port *p; + struct clk *clk; /* * Make sure the serial ports are muxed on at this point. @@ -110,9 +89,16 @@ int __init davinci_serial_init(struct platform_device *serial_dev) if (ret) continue; - ret = davinci_serial_setup_clk(i, &p->uartclk); - if (ret) + clk = clk_get(dev, NULL); + if (IS_ERR(clk)) { + pr_err("%s:%d: failed to get UART%d clock\n", + __func__, __LINE__, i); continue; + } + + clk_prepare_enable(clk); + + p->uartclk = clk_get_rate(clk); if (!p->membase && p->mapbase) { p->membase = ioremap(p->mapbase, SZ_4K); |