diff options
Diffstat (limited to 'drivers/tty/serial/pxa.c')
-rw-r--r-- | drivers/tty/serial/pxa.c | 17 |
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 | ||
99 | static inline void receive_chars(struct uart_pxa_port *up, int *status) | 99 | static 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 | ||