summaryrefslogtreecommitdiff
path: root/drivers/tty/ipwireless/tty.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-09-12 05:00:08 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2018-10-13 07:50:31 +0300
commita7b06fcf2ecef39b37979ac8b8838a182ba569e2 (patch)
treebc083662c755e00dce71f6d3054ab6cc2c91626d /drivers/tty/ipwireless/tty.c
parent6fbf9582548105e7548a2342f67b32977fe8a43a (diff)
downloadlinux-a7b06fcf2ecef39b37979ac8b8838a182ba569e2.tar.xz
ipwireless: switch to ->[sg]et_serial()
Acked-by: David Sterba <dsterba@suse.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/tty/ipwireless/tty.c')
-rw-r--r--drivers/tty/ipwireless/tty.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index 1ef751c27ac6..fad3401e604d 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -248,22 +248,29 @@ static int ipw_write_room(struct tty_struct *linux_tty)
return room;
}
-static int ipwireless_get_serial_info(struct ipw_tty *tty,
- struct serial_struct __user *retinfo)
+static int ipwireless_get_serial_info(struct tty_struct *linux_tty,
+ struct serial_struct *ss)
{
- struct serial_struct tmp;
+ struct ipw_tty *tty = linux_tty->driver_data;
- memset(&tmp, 0, sizeof(tmp));
- tmp.type = PORT_UNKNOWN;
- tmp.line = tty->index;
- tmp.baud_base = 115200;
+ if (!tty)
+ return -ENODEV;
- if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return -EFAULT;
+ if (!tty->port.count)
+ return -EINVAL;
+ ss->type = PORT_UNKNOWN;
+ ss->line = tty->index;
+ ss->baud_base = 115200;
return 0;
}
+static int ipwireless_set_serial_info(struct tty_struct *linux_tty,
+ struct serial_struct *ss)
+{
+ return 0; /* Keeps the PCMCIA scripts happy. */
+}
+
static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
{
struct ipw_tty *tty = linux_tty->driver_data;
@@ -386,15 +393,6 @@ static int ipw_ioctl(struct tty_struct *linux_tty,
return -EINVAL;
/* FIXME: Exactly how is the tty object locked here .. */
-
- switch (cmd) {
- case TIOCGSERIAL:
- return ipwireless_get_serial_info(tty, (void __user *) arg);
-
- case TIOCSSERIAL:
- return 0; /* Keeps the PCMCIA scripts happy. */
- }
-
if (tty->tty_type == TTYTYPE_MODEM) {
switch (cmd) {
case PPPIOCGCHAN:
@@ -561,6 +559,8 @@ static const struct tty_operations tty_ops = {
.chars_in_buffer = ipw_chars_in_buffer,
.tiocmget = ipw_tiocmget,
.tiocmset = ipw_tiocmset,
+ .set_serial = ipwireless_set_serial_info,
+ .get_serial = ipwireless_get_serial_info,
};
int ipwireless_tty_init(void)