diff options
author | Alan Cox <alan@redhat.com> | 2008-07-22 06:18:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 16:03:28 -0400 |
commit | 9e98966c7bb94355689478bc84cc3e0c190f977e (patch) | |
tree | 928aebbfee524a48aa94a3d3def5249c8846a79a /drivers/char/synclink.c | |
parent | abbe629ae4011d2020047f41bea9f9e4b0ec4361 (diff) |
tty: rework break handling
Some hardware needs to do break handling itself and may have partial
support only. Make break_ctl return an error code. Add a tty driver flag
so you can indicate driver hardware side break support.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/synclink.c')
-rw-r--r-- | drivers/char/synclink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 527d220aa4aa..ef6706f09061 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -2897,9 +2897,9 @@ static int tiocmset(struct tty_struct *tty, struct file *file, | |||
2897 | * | 2897 | * |
2898 | * Arguments: tty pointer to tty instance data | 2898 | * Arguments: tty pointer to tty instance data |
2899 | * break_state -1=set break condition, 0=clear | 2899 | * break_state -1=set break condition, 0=clear |
2900 | * Return Value: None | 2900 | * Return Value: error code |
2901 | */ | 2901 | */ |
2902 | static void mgsl_break(struct tty_struct *tty, int break_state) | 2902 | static int mgsl_break(struct tty_struct *tty, int break_state) |
2903 | { | 2903 | { |
2904 | struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data; | 2904 | struct mgsl_struct * info = (struct mgsl_struct *)tty->driver_data; |
2905 | unsigned long flags; | 2905 | unsigned long flags; |
@@ -2909,7 +2909,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state) | |||
2909 | __FILE__,__LINE__, info->device_name, break_state); | 2909 | __FILE__,__LINE__, info->device_name, break_state); |
2910 | 2910 | ||
2911 | if (mgsl_paranoia_check(info, tty->name, "mgsl_break")) | 2911 | if (mgsl_paranoia_check(info, tty->name, "mgsl_break")) |
2912 | return; | 2912 | return -EINVAL; |
2913 | 2913 | ||
2914 | spin_lock_irqsave(&info->irq_spinlock,flags); | 2914 | spin_lock_irqsave(&info->irq_spinlock,flags); |
2915 | if (break_state == -1) | 2915 | if (break_state == -1) |
@@ -2917,6 +2917,7 @@ static void mgsl_break(struct tty_struct *tty, int break_state) | |||
2917 | else | 2917 | else |
2918 | usc_OutReg(info,IOCR,(u16)(usc_InReg(info,IOCR) & ~BIT7)); | 2918 | usc_OutReg(info,IOCR,(u16)(usc_InReg(info,IOCR) & ~BIT7)); |
2919 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 2919 | spin_unlock_irqrestore(&info->irq_spinlock,flags); |
2920 | return 0; | ||
2920 | 2921 | ||
2921 | } /* end of mgsl_break() */ | 2922 | } /* end of mgsl_break() */ |
2922 | 2923 | ||