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

tty: Fix various bogus WARN checks in the usb serial layer

We are now refcounted and all the port.count checking is no longer valid
and in fact produces false warnings.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
49d3380e bd07c551

-13
-13
drivers/usb/serial/usb-serial.c
··· 358 358 359 359 dbg("%s - port %d, %d byte(s)", __func__, port->number, count); 360 360 361 - /* count is managed under the mutex lock for the tty so cannot 362 - drop to zero until after the last close completes */ 363 - WARN_ON(!port->port.count); 364 - 365 361 /* pass on to the driver specific version of this function */ 366 362 retval = port->serial->type->write(tty, port, buf, count); 367 363 ··· 369 373 { 370 374 struct usb_serial_port *port = tty->driver_data; 371 375 dbg("%s - port %d", __func__, port->number); 372 - WARN_ON(!port->port.count); 373 376 /* pass on to the driver specific version of this function */ 374 377 return port->serial->type->write_room(tty); 375 378 } ··· 391 396 struct usb_serial_port *port = tty->driver_data; 392 397 dbg("%s - port %d", __func__, port->number); 393 398 394 - WARN_ON(!port->port.count); 395 399 /* pass on to the driver specific version of this function */ 396 400 if (port->serial->type->throttle) 397 401 port->serial->type->throttle(tty); ··· 401 407 struct usb_serial_port *port = tty->driver_data; 402 408 dbg("%s - port %d", __func__, port->number); 403 409 404 - WARN_ON(!port->port.count); 405 410 /* pass on to the driver specific version of this function */ 406 411 if (port->serial->type->unthrottle) 407 412 port->serial->type->unthrottle(tty); ··· 413 420 int retval = -ENODEV; 414 421 415 422 dbg("%s - port %d, cmd 0x%.4x", __func__, port->number, cmd); 416 - 417 - WARN_ON(!port->port.count); 418 423 419 424 /* pass on to the driver specific version of this function 420 425 if it is available */ ··· 428 437 struct usb_serial_port *port = tty->driver_data; 429 438 dbg("%s - port %d", __func__, port->number); 430 439 431 - WARN_ON(!port->port.count); 432 440 /* pass on to the driver specific version of this function 433 441 if it is available */ 434 442 if (port->serial->type->set_termios) ··· 442 452 443 453 dbg("%s - port %d", __func__, port->number); 444 454 445 - WARN_ON(!port->port.count); 446 455 /* pass on to the driver specific version of this function 447 456 if it is available */ 448 457 if (port->serial->type->break_ctl) ··· 502 513 503 514 dbg("%s - port %d", __func__, port->number); 504 515 505 - WARN_ON(!port->port.count); 506 516 if (port->serial->type->tiocmget) 507 517 return port->serial->type->tiocmget(tty, file); 508 518 return -EINVAL; ··· 514 526 515 527 dbg("%s - port %d", __func__, port->number); 516 528 517 - WARN_ON(!port->port.count); 518 529 if (port->serial->type->tiocmset) 519 530 return port->serial->type->tiocmset(tty, file, set, clear); 520 531 return -EINVAL;