aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sunsu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sunsu.c')
-rw-r--r--drivers/tty/serial/sunsu.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 5326ae195e5f..be010f893868 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -264,7 +264,8 @@ static inline void __stop_tx(struct uart_sunsu_port *p)
264 264
265static void sunsu_stop_tx(struct uart_port *port) 265static void sunsu_stop_tx(struct uart_port *port)
266{ 266{
267 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 267 struct uart_sunsu_port *up =
268 container_of(port, struct uart_sunsu_port, port);
268 269
269 __stop_tx(up); 270 __stop_tx(up);
270 271
@@ -279,7 +280,8 @@ static void sunsu_stop_tx(struct uart_port *port)
279 280
280static void sunsu_start_tx(struct uart_port *port) 281static void sunsu_start_tx(struct uart_port *port)
281{ 282{
282 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 283 struct uart_sunsu_port *up =
284 container_of(port, struct uart_sunsu_port, port);
283 285
284 if (!(up->ier & UART_IER_THRI)) { 286 if (!(up->ier & UART_IER_THRI)) {
285 up->ier |= UART_IER_THRI; 287 up->ier |= UART_IER_THRI;
@@ -297,7 +299,8 @@ static void sunsu_start_tx(struct uart_port *port)
297 299
298static void sunsu_stop_rx(struct uart_port *port) 300static void sunsu_stop_rx(struct uart_port *port)
299{ 301{
300 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 302 struct uart_sunsu_port *up =
303 container_of(port, struct uart_sunsu_port, port);
301 304
302 up->ier &= ~UART_IER_RLSI; 305 up->ier &= ~UART_IER_RLSI;
303 up->port.read_status_mask &= ~UART_LSR_DR; 306 up->port.read_status_mask &= ~UART_LSR_DR;
@@ -306,7 +309,8 @@ static void sunsu_stop_rx(struct uart_port *port)
306 309
307static void sunsu_enable_ms(struct uart_port *port) 310static void sunsu_enable_ms(struct uart_port *port)
308{ 311{
309 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 312 struct uart_sunsu_port *up =
313 container_of(port, struct uart_sunsu_port, port);
310 unsigned long flags; 314 unsigned long flags;
311 315
312 spin_lock_irqsave(&up->port.lock, flags); 316 spin_lock_irqsave(&up->port.lock, flags);
@@ -543,7 +547,8 @@ static irqreturn_t sunsu_kbd_ms_interrupt(int irq, void *dev_id)
543 547
544static unsigned int sunsu_tx_empty(struct uart_port *port) 548static unsigned int sunsu_tx_empty(struct uart_port *port)
545{ 549{
546 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 550 struct uart_sunsu_port *up =
551 container_of(port, struct uart_sunsu_port, port);
547 unsigned long flags; 552 unsigned long flags;
548 unsigned int ret; 553 unsigned int ret;
549 554
@@ -556,7 +561,8 @@ static unsigned int sunsu_tx_empty(struct uart_port *port)
556 561
557static unsigned int sunsu_get_mctrl(struct uart_port *port) 562static unsigned int sunsu_get_mctrl(struct uart_port *port)
558{ 563{
559 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 564 struct uart_sunsu_port *up =
565 container_of(port, struct uart_sunsu_port, port);
560 unsigned char status; 566 unsigned char status;
561 unsigned int ret; 567 unsigned int ret;
562 568
@@ -576,7 +582,8 @@ static unsigned int sunsu_get_mctrl(struct uart_port *port)
576 582
577static void sunsu_set_mctrl(struct uart_port *port, unsigned int mctrl) 583static void sunsu_set_mctrl(struct uart_port *port, unsigned int mctrl)
578{ 584{
579 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 585 struct uart_sunsu_port *up =
586 container_of(port, struct uart_sunsu_port, port);
580 unsigned char mcr = 0; 587 unsigned char mcr = 0;
581 588
582 if (mctrl & TIOCM_RTS) 589 if (mctrl & TIOCM_RTS)
@@ -595,7 +602,8 @@ static void sunsu_set_mctrl(struct uart_port *port, unsigned int mctrl)
595 602
596static void sunsu_break_ctl(struct uart_port *port, int break_state) 603static void sunsu_break_ctl(struct uart_port *port, int break_state)
597{ 604{
598 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 605 struct uart_sunsu_port *up =
606 container_of(port, struct uart_sunsu_port, port);
599 unsigned long flags; 607 unsigned long flags;
600 608
601 spin_lock_irqsave(&up->port.lock, flags); 609 spin_lock_irqsave(&up->port.lock, flags);
@@ -609,7 +617,8 @@ static void sunsu_break_ctl(struct uart_port *port, int break_state)
609 617
610static int sunsu_startup(struct uart_port *port) 618static int sunsu_startup(struct uart_port *port)
611{ 619{
612 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 620 struct uart_sunsu_port *up =
621 container_of(port, struct uart_sunsu_port, port);
613 unsigned long flags; 622 unsigned long flags;
614 int retval; 623 int retval;
615 624
@@ -719,7 +728,8 @@ static int sunsu_startup(struct uart_port *port)
719 728
720static void sunsu_shutdown(struct uart_port *port) 729static void sunsu_shutdown(struct uart_port *port)
721{ 730{
722 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 731 struct uart_sunsu_port *up =
732 container_of(port, struct uart_sunsu_port, port);
723 unsigned long flags; 733 unsigned long flags;
724 734
725 /* 735 /*
@@ -767,7 +777,8 @@ static void
767sunsu_change_speed(struct uart_port *port, unsigned int cflag, 777sunsu_change_speed(struct uart_port *port, unsigned int cflag,
768 unsigned int iflag, unsigned int quot) 778 unsigned int iflag, unsigned int quot)
769{ 779{
770 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 780 struct uart_sunsu_port *up =
781 container_of(port, struct uart_sunsu_port, port);
771 unsigned char cval, fcr = 0; 782 unsigned char cval, fcr = 0;
772 unsigned long flags; 783 unsigned long flags;
773 784
@@ -918,7 +929,8 @@ static int sunsu_request_port(struct uart_port *port)
918 929
919static void sunsu_config_port(struct uart_port *port, int flags) 930static void sunsu_config_port(struct uart_port *port, int flags)
920{ 931{
921 struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; 932 struct uart_sunsu_port *up =
933 container_of(port, struct uart_sunsu_port, port);
922 934
923 if (flags & UART_CONFIG_TYPE) { 935 if (flags & UART_CONFIG_TYPE) {
924 /* 936 /*
@@ -1277,7 +1289,8 @@ static __inline__ void wait_for_xmitr(struct uart_sunsu_port *up)
1277 1289
1278static void sunsu_console_putchar(struct uart_port *port, int ch) 1290static void sunsu_console_putchar(struct uart_port *port, int ch)
1279{ 1291{
1280 struct uart_sunsu_port *up = (struct uart_sunsu_port *)port; 1292 struct uart_sunsu_port *up =
1293 container_of(port, struct uart_sunsu_port, port);
1281 1294
1282 wait_for_xmitr(up); 1295 wait_for_xmitr(up);
1283 serial_out(up, UART_TX, ch); 1296 serial_out(up, UART_TX, ch);