aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/pxa.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
commit21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch)
treed995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/tty/serial/pxa.c
parent74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff)
parent9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff)
Merge tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
Diffstat (limited to 'drivers/tty/serial/pxa.c')
-rw-r--r--drivers/tty/serial/pxa.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 2764828251f5..05f504e0c271 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -98,7 +98,6 @@ static void serial_pxa_stop_rx(struct uart_port *port)
98 98
99static inline void receive_chars(struct uart_pxa_port *up, int *status) 99static inline void receive_chars(struct uart_pxa_port *up, int *status)
100{ 100{
101 struct tty_struct *tty = up->port.state->port.tty;
102 unsigned int ch, flag; 101 unsigned int ch, flag;
103 int max_count = 256; 102 int max_count = 256;
104 103
@@ -168,7 +167,7 @@ static inline void receive_chars(struct uart_pxa_port *up, int *status)
168 ignore_char: 167 ignore_char:
169 *status = serial_in(up, UART_LSR); 168 *status = serial_in(up, UART_LSR);
170 } while ((*status & UART_LSR_DR) && (max_count-- > 0)); 169 } while ((*status & UART_LSR_DR) && (max_count-- > 0));
171 tty_flip_buffer_push(tty); 170 tty_flip_buffer_push(&up->port.state->port);
172 171
173 /* work around Errata #20 according to 172 /* work around Errata #20 according to
174 * Intel(R) PXA27x Processor Family 173 * Intel(R) PXA27x Processor Family
@@ -673,8 +672,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
673 unsigned long flags; 672 unsigned long flags;
674 int locked = 1; 673 int locked = 1;
675 674
676 clk_prepare_enable(up->clk); 675 clk_enable(up->clk);
677
678 local_irq_save(flags); 676 local_irq_save(flags);
679 if (up->port.sysrq) 677 if (up->port.sysrq)
680 locked = 0; 678 locked = 0;
@@ -701,8 +699,8 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
701 if (locked) 699 if (locked)
702 spin_unlock(&up->port.lock); 700 spin_unlock(&up->port.lock);
703 local_irq_restore(flags); 701 local_irq_restore(flags);
702 clk_disable(up->clk);
704 703
705 clk_disable_unprepare(up->clk);
706} 704}
707 705
708#ifdef CONFIG_CONSOLE_POLL 706#ifdef CONFIG_CONSOLE_POLL
@@ -899,6 +897,12 @@ static int serial_pxa_probe(struct platform_device *dev)
899 goto err_free; 897 goto err_free;
900 } 898 }
901 899
900 ret = clk_prepare(sport->clk);
901 if (ret) {
902 clk_put(sport->clk);
903 goto err_free;
904 }
905
902 sport->port.type = PORT_PXA; 906 sport->port.type = PORT_PXA;
903 sport->port.iotype = UPIO_MEM; 907 sport->port.iotype = UPIO_MEM;
904 sport->port.mapbase = mmres->start; 908 sport->port.mapbase = mmres->start;
@@ -930,6 +934,7 @@ static int serial_pxa_probe(struct platform_device *dev)
930 return 0; 934 return 0;
931 935
932 err_clk: 936 err_clk:
937 clk_unprepare(sport->clk);
933 clk_put(sport->clk); 938 clk_put(sport->clk);
934 err_free: 939 err_free:
935 kfree(sport); 940 kfree(sport);
@@ -943,6 +948,8 @@ static int serial_pxa_remove(struct platform_device *dev)
943 platform_set_drvdata(dev, NULL); 948 platform_set_drvdata(dev, NULL);
944 949
945 uart_remove_one_port(&serial_pxa_reg, &sport->port); 950 uart_remove_one_port(&serial_pxa_reg, &sport->port);
951
952 clk_unprepare(sport->clk);
946 clk_put(sport->clk); 953 clk_put(sport->clk);
947 kfree(sport); 954 kfree(sport);
948 955