public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ia64 simserial.c for Ldisc revamp
@ 2008-07-10 20:46 Luck, Tony
  2008-07-11 13:50 ` Alan Cox
  2008-07-11 15:42 ` Alan Cox
  0 siblings, 2 replies; 4+ messages in thread
From: Luck, Tony @ 2008-07-10 20:46 UTC (permalink / raw)
  To: alan@redhat.com; +Cc: linux-kernel@vger.kernel.org

This driver is "hidden" in arch/ia64 ... so it didn't get updated
by the Ldisc revamp.

Signed-off-by: Tony Luck <tony.luck@intel.com>


diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 23cafc8..f870bbf 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -354,8 +354,8 @@ static void rs_flush_buffer(struct tty_struct *tty)
        wake_up_interruptible(&tty->write_wait);

        if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-           tty->ldisc.write_wakeup)
-               (tty->ldisc.write_wakeup)(tty);
+           tty->ldisc.ops->write_wakeup)
+               (tty->ldisc.ops->write_wakeup)(tty);
 }

 /*
@@ -407,8 +407,9 @@ static void rs_unthrottle(struct tty_struct * tty)
 /*
  * rs_break() --- routine which turns the break handling on or off
  */
-static void rs_break(struct tty_struct *tty, int break_state)
+static int rs_break(struct tty_struct *tty, int break_state)
 {
+       return 0;
 }

 static int rs_ioctl(struct tty_struct *tty, struct file * file,
@@ -625,7 +626,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
        shutdown(info);
        if (tty->ops->flush_buffer)
                tty->ops->flush_buffer(tty);
-       if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty);
+       if (tty->ldisc.ops->flush_buffer) tty->ldisc.ops->flush_buffer(tty);
        info->event = 0;
        info->tty = NULL;
        if (info->blocked_open) {



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix ia64 simserial.c for Ldisc revamp
  2008-07-10 20:46 [PATCH] Fix ia64 simserial.c for Ldisc revamp Luck, Tony
@ 2008-07-11 13:50 ` Alan Cox
  2008-07-11 15:42 ` Alan Cox
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Cox @ 2008-07-11 13:50 UTC (permalink / raw)
  To: Luck, Tony; +Cc: alan@redhat.com, linux-kernel@vger.kernel.org

On Thu, Jul 10, 2008 at 01:46:49PM -0700, Luck, Tony wrote:
> This driver is "hidden" in arch/ia64 ... so it didn't get updated
> by the Ldisc revamp.
> 
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> 
> 
> @@ -354,8 +354,8 @@ static void rs_flush_buffer(struct tty_struct *tty)
>         wake_up_interruptible(&tty->write_wait);
> 
>         if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
> -           tty->ldisc.write_wakeup)
> -               (tty->ldisc.write_wakeup)(tty);
> +           tty->ldisc.ops->write_wakeup)
> +               (tty->ldisc.ops->write_wakeup)(tty);

We have a tty_wakeup method, drivers shouldn't be poking around in
tty flags any more

> -       if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty);
> +       if (tty->ldisc.ops->flush_buffer) tty->ldisc.ops->flush_buffer(tty);

And we have a method for that too 8)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix ia64 simserial.c for Ldisc revamp
  2008-07-10 20:46 [PATCH] Fix ia64 simserial.c for Ldisc revamp Luck, Tony
  2008-07-11 13:50 ` Alan Cox
@ 2008-07-11 15:42 ` Alan Cox
  2008-07-11 16:20   ` Luck, Tony
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Cox @ 2008-07-11 15:42 UTC (permalink / raw)
  To: Luck, Tony; +Cc: alan@redhat.com, linux-kernel@vger.kernel.org

On Thu, 10 Jul 2008 13:46:49 -0700
"Luck, Tony" <tony.luck@intel.com> wrote:

> This driver is "hidden" in arch/ia64 ... so it didn't get updated
> by the Ldisc revamp.

How does this look instead

simserial: Fix up for ldisc changes

From: Alan Cox <alan@redhat.com>

Noted by Tony Luck although I've done the patches differently and also
removed some other bogus oddments.

Signed-off-by: Alan Cox <alan@redhat.com>
---

 arch/ia64/hp/sim/simserial.c |   44 +++---------------------------------------
 1 files changed, 3 insertions(+), 41 deletions(-)


diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 23cafc8..84879f6 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -193,18 +193,6 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id)
  * -------------------------------------------------------------------
  */
 
-#if 0
-/*
- * not really used in our situation so keep them commented out for now
- */
-static DECLARE_TASK_QUEUE(tq_serial); /* used to be at the top of the file */
-static void do_serial_bh(void)
-{
-	run_task_queue(&tq_serial);
-	printk(KERN_ERR "do_serial_bh: called\n");
-}
-#endif
-
 static void do_softint(struct work_struct *private_)
 {
 	printk(KERN_ERR "simserial: do_softint called\n");
@@ -351,11 +339,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
 	info->xmit.head = info->xmit.tail = 0;
 	local_irq_restore(flags);
 
-	wake_up_interruptible(&tty->write_wait);
-
-	if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-	    tty->ldisc.write_wakeup)
-		(tty->ldisc.write_wakeup)(tty);
+	tty_wakeup(tty);
 }
 
 /*
@@ -404,12 +388,6 @@ static void rs_unthrottle(struct tty_struct * tty)
 	printk(KERN_INFO "simrs_unthrottle called\n");
 }
 
-/*
- * rs_break() --- routine which turns the break handling on or off
- */
-static void rs_break(struct tty_struct *tty, int break_state)
-{
-}
 
 static int rs_ioctl(struct tty_struct *tty, struct file * file,
 		    unsigned int cmd, unsigned long arg)
@@ -422,14 +400,6 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
 	}
 
 	switch (cmd) {
-		case TIOCMGET:
-			printk(KERN_INFO "rs_ioctl: TIOCMGET called\n");
-			return -EINVAL;
-		case TIOCMBIS:
-		case TIOCMBIC:
-		case TIOCMSET:
-			printk(KERN_INFO "rs_ioctl: TIOCMBIS/BIC/SET called\n");
-			return -EINVAL;
 		case TIOCGSERIAL:
 			printk(KERN_INFO "simrs_ioctl TIOCGSERIAL called\n");
 			return 0;
@@ -490,12 +460,6 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 {
 	unsigned int cflag = tty->termios->c_cflag;
 
-	if (   (cflag == old_termios->c_cflag)
-	    && (   RELEVANT_IFLAG(tty->termios->c_iflag)
-		== RELEVANT_IFLAG(old_termios->c_iflag)))
-	  return;
-
-
 	/* Handle turning off CRTSCTS */
 	if ((old_termios->c_cflag & CRTSCTS) &&
 	    !(tty->termios->c_cflag & CRTSCTS)) {
@@ -623,9 +587,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
 	 * the line discipline to only process XON/XOFF characters.
 	 */
 	shutdown(info);
-	if (tty->ops->flush_buffer)
-		tty->ops->flush_buffer(tty);
-	if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty);
+	rs_flush_buffer(tty);
+	tty_ldisc_flush(tty)
 	info->event = 0;
 	info->tty = NULL;
 	if (info->blocked_open) {
@@ -955,7 +918,6 @@ static const struct tty_operations hp_ops = {
 	.stop = rs_stop,
 	.start = rs_start,
 	.hangup = rs_hangup,
-	.break_ctl = rs_break,
 	.wait_until_sent = rs_wait_until_sent,
 	.read_proc = rs_read_proc,
 };

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] Fix ia64 simserial.c for Ldisc revamp
  2008-07-11 15:42 ` Alan Cox
@ 2008-07-11 16:20   ` Luck, Tony
  0 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2008-07-11 16:20 UTC (permalink / raw)
  To: Alan Cox; +Cc: alan@redhat.com, linux-kernel@vger.kernel.org

> How does this look instead

@@ -490,12 +460,6 @@ static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios)
 {
        unsigned int cflag = tty->termios->c_cflag;

-       if (   (cflag == old_termios->c_cflag)
-           && (   RELEVANT_IFLAG(tty->termios->c_iflag)
-               == RELEVANT_IFLAG(old_termios->c_iflag)))
-         return;

Since you deleted the only use of "cflag" in this function, you can delete
the declaration too.

@@ -623,9 +587,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
         * the line discipline to only process XON/XOFF characters.
         */
        shutdown(info);
-       if (tty->ops->flush_buffer)
-               tty->ops->flush_buffer(tty);
-       if (tty->ldisc.flush_buffer) tty->ldisc.flush_buffer(tty);
+       rs_flush_buffer(tty);
+       tty_ldisc_flush(tty)

A ';' on the end of this line would make the compiler much happier :-)


With these two additions it looks great.

Thanks

-Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-11 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 20:46 [PATCH] Fix ia64 simserial.c for Ldisc revamp Luck, Tony
2008-07-11 13:50 ` Alan Cox
2008-07-11 15:42 ` Alan Cox
2008-07-11 16:20   ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox