Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

opticon: switch to ->get_serial()

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 30296aa4 b27ef409

+13 -32
+13 -32
drivers/usb/serial/opticon.c
··· 328 328 return 0; 329 329 } 330 330 331 - static int get_serial_info(struct usb_serial_port *port, 332 - struct serial_struct __user *serial) 333 - { 334 - struct serial_struct tmp; 335 - 336 - memset(&tmp, 0x00, sizeof(tmp)); 337 - 338 - /* fake emulate a 16550 uart to make userspace code happy */ 339 - tmp.type = PORT_16550A; 340 - tmp.line = port->minor; 341 - tmp.port = 0; 342 - tmp.irq = 0; 343 - tmp.xmit_fifo_size = 1024; 344 - tmp.baud_base = 9600; 345 - tmp.close_delay = 5*HZ; 346 - tmp.closing_wait = 30*HZ; 347 - 348 - if (copy_to_user(serial, &tmp, sizeof(*serial))) 349 - return -EFAULT; 350 - return 0; 351 - } 352 - 353 - static int opticon_ioctl(struct tty_struct *tty, 354 - unsigned int cmd, unsigned long arg) 331 + static int get_serial_info(struct tty_struct *tty, 332 + struct serial_struct *ss) 355 333 { 356 334 struct usb_serial_port *port = tty->driver_data; 357 335 358 - switch (cmd) { 359 - case TIOCGSERIAL: 360 - return get_serial_info(port, 361 - (struct serial_struct __user *)arg); 362 - } 363 - 364 - return -ENOIOCTLCMD; 336 + /* fake emulate a 16550 uart to make userspace code happy */ 337 + ss->type = PORT_16550A; 338 + ss->line = port->minor; 339 + ss->port = 0; 340 + ss->irq = 0; 341 + ss->xmit_fifo_size = 1024; 342 + ss->baud_base = 9600; 343 + ss->close_delay = 5*HZ; 344 + ss->closing_wait = 30*HZ; 345 + return 0; 365 346 } 366 347 367 348 static int opticon_port_probe(struct usb_serial_port *port) ··· 385 404 .write_room = opticon_write_room, 386 405 .throttle = usb_serial_generic_throttle, 387 406 .unthrottle = usb_serial_generic_unthrottle, 388 - .ioctl = opticon_ioctl, 407 + .get_serial = get_serial_info, 389 408 .tiocmget = opticon_tiocmget, 390 409 .tiocmset = opticon_tiocmset, 391 410 .process_read_urb = opticon_process_read_urb,