Commit 732730d48dc777f6577a6e0fece42b860324998e

Authored by Geert Uytterhoeven
Committed by Linus Torvalds
1 parent bdee6ac7d1

m68k: gs: use tty_port fixes

commit b5391e29f428d11755ca2c91074c6db6f5c69d7c ("gs: use tty_port")
forgot to update the m68k gs serial drivers.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 56 additions and 55 deletions Side-by-side Diff

drivers/char/ser_a2232.c
... ... @@ -192,7 +192,7 @@
192 192 Maybe one could implement a more efficient version by not only
193 193 transferring one character at a time.
194 194 */
195   - struct tty_struct *tty = port->gs.tty;
  195 + struct tty_struct *tty = port->gs.port.tty;
196 196  
197 197 #if 0
198 198 switch(err) {
... ... @@ -226,7 +226,7 @@
226 226  
227 227 /* Does this here really have to be? */
228 228 local_irq_save(flags);
229   - port->gs.flags &= ~GS_TX_INTEN;
  229 + port->gs.port.flags &= ~GS_TX_INTEN;
230 230 local_irq_restore(flags);
231 231 }
232 232  
... ... @@ -242,7 +242,7 @@
242 242  
243 243 /* Does this here really have to be? */
244 244 local_irq_save(flags);
245   - port->gs.flags |= GS_TX_INTEN;
  245 + port->gs.port.flags |= GS_TX_INTEN;
246 246 local_irq_restore(flags);
247 247 }
248 248  
249 249  
... ... @@ -276,9 +276,9 @@
276 276  
277 277 local_irq_save(flags);
278 278  
279   - port->gs.flags &= ~GS_ACTIVE;
  279 + port->gs.port.flags &= ~GS_ACTIVE;
280 280  
281   - if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL) {
  281 + if (port->gs.port.tty && port->gs.port.tty->termios->c_cflag & HUPCL) {
282 282 /* Set DTR and RTS to Low, flush output.
283 283 The NetBSD driver "msc.c" does it this way. */
284 284 stat->Command = ( (stat->Command & ~A2232CMD_CMask) |
... ... @@ -309,7 +309,7 @@
309 309 volatile struct a2232status *status;
310 310 volatile struct a2232memory *mem;
311 311  
312   - if (!port->gs.tty || !port->gs.tty->termios) return 0;
  312 + if (!port->gs.port.tty || !port->gs.port.tty->termios) return 0;
313 313  
314 314 status = a2232stat(port->which_a2232, port->which_port_on_a2232);
315 315 mem = a2232mem(port->which_a2232);
... ... @@ -345,7 +345,7 @@
345 345 }
346 346 a2232_param |= rate;
347 347  
348   - cflag = port->gs.tty->termios->c_cflag;
  348 + cflag = port->gs.port.tty->termios->c_cflag;
349 349  
350 350 // get character size
351 351 chsize = cflag & CSIZE;
... ... @@ -382,7 +382,7 @@
382 382 the conventional way of inserting START/STOP characters
383 383 by hand in throttle()/unthrottle().
384 384 */
385   - softflow = !!( port->gs.tty->termios->c_iflag & IXOFF );
  385 + softflow = !!( port->gs.port.tty->termios->c_iflag & IXOFF );
386 386  
387 387 // get Parity (Enabled/Disabled? If Enabled, Odd or Even?)
388 388 parity = cflag & (PARENB | PARODD);
389 389  
... ... @@ -400,9 +400,9 @@
400 400 /* Hmm. Maybe an own a2232_port structure
401 401 member would be cleaner? */
402 402 if (cflag & CLOCAL)
403   - port->gs.flags &= ~ASYNC_CHECK_CD;
  403 + port->gs.port.flags &= ~ASYNC_CHECK_CD;
404 404 else
405   - port->gs.flags |= ASYNC_CHECK_CD;
  405 + port->gs.port.flags |= ASYNC_CHECK_CD;
406 406  
407 407  
408 408 /* Now we have all parameters and can go to set them: */
409 409  
410 410  
411 411  
... ... @@ -482,18 +482,18 @@
482 482 port = &a2232_ports[line];
483 483  
484 484 tty->driver_data = port;
485   - port->gs.tty = tty;
486   - port->gs.count++;
  485 + port->gs.port.tty = tty;
  486 + port->gs.port.count++;
487 487 retval = gs_init_port(&port->gs);
488 488 if (retval) {
489   - port->gs.count--;
  489 + port->gs.port.count--;
490 490 return retval;
491 491 }
492   - port->gs.flags |= GS_ACTIVE;
  492 + port->gs.port.flags |= GS_ACTIVE;
493 493 retval = gs_block_til_ready(port, filp);
494 494  
495 495 if (retval) {
496   - port->gs.count--;
  496 + port->gs.port.count--;
497 497 return retval;
498 498 }
499 499  
... ... @@ -522,7 +522,7 @@
522 522 for (p = 0; p < NUMLINES; p++){ /* for every port on this board */
523 523 err = 0;
524 524 port = &a2232_ports[n*NUMLINES+p];
525   - if ( port->gs.flags & GS_ACTIVE ){ /* if the port is used */
  525 + if ( port->gs.port.flags & GS_ACTIVE ){ /* if the port is used */
526 526  
527 527 status = a2232stat(n,p);
528 528  
... ... @@ -577,8 +577,8 @@
577 577 obuf = mem->OutBuf[p];
578 578 bufpos = status->OutHead;
579 579 while ( (port->gs.xmit_cnt > 0) &&
580   - (!port->gs.tty->stopped) &&
581   - (!port->gs.tty->hw_stopped) ){ /* While there are chars to transmit */
  580 + (!port->gs.port.tty->stopped) &&
  581 + (!port->gs.port.tty->hw_stopped) ){ /* While there are chars to transmit */
582 582 if (((bufpos+1) & A2232_IOBUFLENMASK) != status->OutTail) { /* If the A2232 buffer is not full */
583 583 ch = port->gs.xmit_buf[port->gs.xmit_tail]; /* get the next char to transmit */
584 584 port->gs.xmit_tail = (port->gs.xmit_tail+1) & (SERIAL_XMIT_SIZE-1); /* modulo-addition for the gs.xmit_buf ring-buffer */
... ... @@ -592,8 +592,8 @@
592 592 status->OutHead = bufpos;
593 593  
594 594 /* WakeUp if output buffer runs low */
595   - if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.tty) {
596   - tty_wakeup(port->gs.tty);
  595 + if ((port->gs.xmit_cnt <= port->gs.wakeup_chars) && port->gs.port.tty) {
  596 + tty_wakeup(port->gs.port.tty);
597 597 }
598 598 } // if the port is used
599 599 } // for every port on the board
600 600  
601 601  
... ... @@ -613,16 +613,16 @@
613 613 struct a2232_port *port = &a2232_ports[n*7+p];
614 614 port->cd_status = !(ncd & 1); /* ncd&1 <=> CD is now off */
615 615  
616   - if (!(port->gs.flags & ASYNC_CHECK_CD))
  616 + if (!(port->gs.port.flags & ASYNC_CHECK_CD))
617 617 ; /* Don't report DCD changes */
618 618 else if (port->cd_status) { // if DCD on: DCD went UP!
619 619  
620 620 /* Are we blocking in open?*/
621   - wake_up_interruptible(&port->gs.open_wait);
  621 + wake_up_interruptible(&port->gs.port.open_wait);
622 622 }
623 623 else { // if DCD off: DCD went DOWN!
624   - if (port->gs.tty)
625   - tty_hangup (port->gs.tty);
  624 + if (port->gs.port.tty)
  625 + tty_hangup (port->gs.port.tty);
626 626 }
627 627  
628 628 } // if CD changed for this port
... ... @@ -655,8 +655,8 @@
655 655 #ifdef NEW_WRITE_LOCKING
656 656 mutex_init(&(port->gs.port_write_mutex));
657 657 #endif
658   - init_waitqueue_head(&port->gs.open_wait);
659   - init_waitqueue_head(&port->gs.close_wait);
  658 + init_waitqueue_head(&port->gs.port.open_wait);
  659 + init_waitqueue_head(&port->gs.port.close_wait);
660 660 }
661 661 }
662 662  
drivers/char/vme_scc.c
... ... @@ -183,8 +183,8 @@
183 183 #ifdef NEW_WRITE_LOCKING
184 184 port->gs.port_write_mutex = MUTEX;
185 185 #endif
186   - init_waitqueue_head(&port->gs.open_wait);
187   - init_waitqueue_head(&port->gs.close_wait);
  186 + init_waitqueue_head(&port->gs.port.open_wait);
  187 + init_waitqueue_head(&port->gs.port.close_wait);
188 188 }
189 189 }
190 190  
... ... @@ -422,7 +422,7 @@
422 422 {
423 423 unsigned char ch;
424 424 struct scc_port *port = data;
425   - struct tty_struct *tty = port->gs.tty;
  425 + struct tty_struct *tty = port->gs.port.tty;
426 426 SCC_ACCESS_INIT(port);
427 427  
428 428 ch = SCCread_NB(RX_DATA_REG);
... ... @@ -453,7 +453,7 @@
453 453 static irqreturn_t scc_spcond_int(int irq, void *data)
454 454 {
455 455 struct scc_port *port = data;
456   - struct tty_struct *tty = port->gs.tty;
  456 + struct tty_struct *tty = port->gs.port.tty;
457 457 unsigned char stat, ch, err;
458 458 int int_pending_mask = port->channel == CHANNEL_A ?
459 459 IPR_A_RX : IPR_B_RX;
... ... @@ -500,7 +500,7 @@
500 500 struct scc_port *port = data;
501 501 SCC_ACCESS_INIT(port);
502 502  
503   - if (!port->gs.tty) {
  503 + if (!port->gs.port.tty) {
504 504 printk(KERN_WARNING "scc_tx_int with NULL tty!\n");
505 505 SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
506 506 SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET);
... ... @@ -512,8 +512,9 @@
512 512 SCCwrite(TX_DATA_REG, port->x_char);
513 513 port->x_char = 0;
514 514 }
515   - else if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
516   - port->gs.tty->hw_stopped)
  515 + else if ((port->gs.xmit_cnt <= 0) ||
  516 + port->gs.port.tty->stopped ||
  517 + port->gs.port.tty->hw_stopped)
517 518 break;
518 519 else {
519 520 SCCwrite(TX_DATA_REG, port->gs.xmit_buf[port->gs.xmit_tail++]);
520 521  
521 522  
... ... @@ -522,15 +523,15 @@
522 523 break;
523 524 }
524 525 }
525   - if ((port->gs.xmit_cnt <= 0) || port->gs.tty->stopped ||
526   - port->gs.tty->hw_stopped) {
  526 + if ((port->gs.xmit_cnt <= 0) || port->gs.port.tty->stopped ||
  527 + port->gs.port.tty->hw_stopped) {
527 528 /* disable tx interrupts */
528 529 SCCmod (INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
529 530 SCCwrite(COMMAND_REG, CR_TX_PENDING_RESET); /* disable tx_int on next tx underrun? */
530   - port->gs.flags &= ~GS_TX_INTEN;
  531 + port->gs.port.flags &= ~GS_TX_INTEN;
531 532 }
532   - if (port->gs.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars)
533   - tty_wakeup(port->gs.tty);
  533 + if (port->gs.port.tty && port->gs.xmit_cnt <= port->gs.wakeup_chars)
  534 + tty_wakeup(port->gs.port.tty);
534 535  
535 536 SCCwrite_NB(COMMAND_REG, CR_HIGHEST_IUS_RESET);
536 537 return IRQ_HANDLED;
537 538  
538 539  
... ... @@ -550,14 +551,14 @@
550 551  
551 552 if (changed & SR_DCD) {
552 553 port->c_dcd = !!(sr & SR_DCD);
553   - if (!(port->gs.flags & ASYNC_CHECK_CD))
  554 + if (!(port->gs.port.flags & ASYNC_CHECK_CD))
554 555 ; /* Don't report DCD changes */
555 556 else if (port->c_dcd) {
556   - wake_up_interruptible(&port->gs.open_wait);
  557 + wake_up_interruptible(&port->gs.port.open_wait);
557 558 }
558 559 else {
559   - if (port->gs.tty)
560   - tty_hangup (port->gs.tty);
  560 + if (port->gs.port.tty)
  561 + tty_hangup (port->gs.port.tty);
561 562 }
562 563 }
563 564 SCCwrite(COMMAND_REG, CR_EXTSTAT_RESET);
... ... @@ -578,7 +579,7 @@
578 579  
579 580 local_irq_save(flags);
580 581 SCCmod(INT_AND_DMA_REG, ~IDR_TX_INT_ENAB, 0);
581   - port->gs.flags &= ~GS_TX_INTEN;
  582 + port->gs.port.flags &= ~GS_TX_INTEN;
582 583 local_irq_restore(flags);
583 584 }
584 585  
... ... @@ -636,8 +637,8 @@
636 637 {
637 638 struct scc_port *port = ptr;
638 639  
639   - port->gs.flags &= ~ GS_ACTIVE;
640   - if (port->gs.tty && port->gs.tty->termios->c_cflag & HUPCL) {
  640 + port->gs.port.flags &= ~ GS_ACTIVE;
  641 + if (port->gs.port.tty && port->gs.port.tty->termios->c_cflag & HUPCL) {
641 642 scc_setsignals (port, 0, 0);
642 643 }
643 644 }
644 645  
... ... @@ -652,14 +653,14 @@
652 653 struct scc_port *port = ptr;
653 654 SCC_ACCESS_INIT(port);
654 655  
655   - if (!port->gs.tty || !port->gs.tty->termios) return 0;
  656 + if (!port->gs.port.tty || !port->gs.port.tty->termios) return 0;
656 657  
657 658 channel = port->channel;
658 659  
659 660 if (channel == CHANNEL_A)
660 661 return 0; /* Settings controlled by boot PROM */
661 662  
662   - cflag = port->gs.tty->termios->c_cflag;
  663 + cflag = port->gs.port.tty->termios->c_cflag;
663 664 baud = port->gs.baud;
664 665 chsize = (cflag & CSIZE) >> 4;
665 666  
666 667  
... ... @@ -678,9 +679,9 @@
678 679 }
679 680  
680 681 if (cflag & CLOCAL)
681   - port->gs.flags &= ~ASYNC_CHECK_CD;
  682 + port->gs.port.flags &= ~ASYNC_CHECK_CD;
682 683 else
683   - port->gs.flags |= ASYNC_CHECK_CD;
  684 + port->gs.port.flags |= ASYNC_CHECK_CD;
684 685  
685 686 #ifdef CONFIG_MVME147_SCC
686 687 if (MACH_IS_MVME147)
... ... @@ -856,7 +857,7 @@
856 857 { COMMAND_REG, CR_EXTSTAT_RESET },
857 858 };
858 859 #endif
859   - if (!(port->gs.flags & ASYNC_INITIALIZED)) {
  860 + if (!(port->gs.port.flags & ASYNC_INITIALIZED)) {
860 861 local_irq_save(flags);
861 862 #if defined(CONFIG_MVME147_SCC) || defined(CONFIG_MVME162_SCC)
862 863 if (MACH_IS_MVME147 || MACH_IS_MVME16x) {
863 864  
864 865  
865 866  
... ... @@ -880,18 +881,18 @@
880 881 }
881 882  
882 883 tty->driver_data = port;
883   - port->gs.tty = tty;
884   - port->gs.count++;
  884 + port->gs.port.tty = tty;
  885 + port->gs.port.count++;
885 886 retval = gs_init_port(&port->gs);
886 887 if (retval) {
887   - port->gs.count--;
  888 + port->gs.port.count--;
888 889 return retval;
889 890 }
890   - port->gs.flags |= GS_ACTIVE;
  891 + port->gs.port.flags |= GS_ACTIVE;
891 892 retval = gs_block_til_ready(port, filp);
892 893  
893 894 if (retval) {
894   - port->gs.count--;
  895 + port->gs.port.count--;
895 896 return retval;
896 897 }
897 898