diff options
author | Alan Cox <alan@redhat.com> | 2007-11-07 01:27:34 -0800 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 04:14:24 -0800 |
commit | d0127539ea9b5fcfe1a1d7d4d57f12384da5190c (patch) | |
tree | ea533cf6c337c9d2fdd9641fb6e67bf895e3b5c8 /drivers/net/hamradio/6pack.c | |
parent | 0fc00e2440b717e19bab1ae0015f03936bdf7967 (diff) | |
download | lwn-d0127539ea9b5fcfe1a1d7d4d57f12384da5190c.tar.gz lwn-d0127539ea9b5fcfe1a1d7d4d57f12384da5190c.zip |
[TTY]: Use tty_mode_ioctl() in network drivers.
We conciously make a change here - we permit mode and speed setting to
be done in things like SLIP mode. There isn't actually a technical
reason to disallow this. It's usually a silly thing to do but we can
do it and soemone might wish to do so.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hamradio/6pack.c')
-rw-r--r-- | drivers/net/hamradio/6pack.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index e0119f6a3319..580cb4ab2af1 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c @@ -762,26 +762,20 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, if (copy_from_user(&addr, (void __user *) arg, AX25_ADDR_LEN)) { - err = -EFAULT; - break; - } + err = -EFAULT; + break; + } - netif_tx_lock_bh(dev); - memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN); - netif_tx_unlock_bh(dev); + netif_tx_lock_bh(dev); + memcpy(dev->dev_addr, &addr, AX25_ADDR_LEN); + netif_tx_unlock_bh(dev); - err = 0; - break; - } - - /* Allow stty to read, but not set, the serial port */ - case TCGETS: - case TCGETA: - err = n_tty_ioctl(tty, (struct file *) file, cmd, arg); - break; + err = 0; + break; + } default: - err = -ENOIOCTLCMD; + err = tty_mode_ioctl(tty, file, cmd, arg); } sp_put(sp); |