--- zzzz-none-000/linux-3.10.107/drivers/usb/serial/whiteheat.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/usb/serial/whiteheat.c 2021-02-04 17:41:59.000000000 +0000 @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -319,12 +318,8 @@ command_info = kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL); - if (command_info == NULL) { - dev_err(&serial->dev->dev, - "%s: Out of memory for port structures\n", - serial->type->description); + if (!command_info) goto no_command_private; - } mutex_init(&command_info->mutex); command_info->port_running = 0; @@ -486,14 +481,12 @@ struct serial_struct serstruct; void __user *user_arg = (void __user *)arg; - dev_dbg(&port->dev, "%s - cmd 0x%.4x\n", __func__, cmd); - switch (cmd) { case TIOCGSERIAL: memset(&serstruct, 0, sizeof(serstruct)); serstruct.type = PORT_16654; - serstruct.line = port->serial->minor; - serstruct.port = port->number; + serstruct.line = port->minor; + serstruct.port = port->port_number; serstruct.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; serstruct.xmit_fifo_size = kfifo_size(&port->write_fifo); serstruct.custom_divisor = 0; @@ -662,7 +655,7 @@ { struct whiteheat_simple open_command; - open_command.port = port->number - port->serial->minor + 1; + open_command.port = port->port_number + 1; return firm_send_command(port, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command)); } @@ -672,7 +665,7 @@ { struct whiteheat_simple close_command; - close_command.port = port->number - port->serial->minor + 1; + close_command.port = port->port_number + 1; return firm_send_command(port, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command)); } @@ -685,7 +678,7 @@ struct whiteheat_port_settings port_settings; unsigned int cflag = tty->termios.c_cflag; - port_settings.port = port->number - port->serial->minor + 1; + port_settings.port = port->port_number + 1; /* get the byte size */ switch (cflag & CSIZE) { @@ -762,7 +755,7 @@ { struct whiteheat_set_rdb rts_command; - rts_command.port = port->number - port->serial->minor + 1; + rts_command.port = port->port_number + 1; rts_command.state = onoff; return firm_send_command(port, WHITEHEAT_SET_RTS, (__u8 *)&rts_command, sizeof(rts_command)); @@ -773,7 +766,7 @@ { struct whiteheat_set_rdb dtr_command; - dtr_command.port = port->number - port->serial->minor + 1; + dtr_command.port = port->port_number + 1; dtr_command.state = onoff; return firm_send_command(port, WHITEHEAT_SET_DTR, (__u8 *)&dtr_command, sizeof(dtr_command)); @@ -784,7 +777,7 @@ { struct whiteheat_set_rdb break_command; - break_command.port = port->number - port->serial->minor + 1; + break_command.port = port->port_number + 1; break_command.state = onoff; return firm_send_command(port, WHITEHEAT_SET_BREAK, (__u8 *)&break_command, sizeof(break_command)); @@ -795,7 +788,7 @@ { struct whiteheat_purge purge_command; - purge_command.port = port->number - port->serial->minor + 1; + purge_command.port = port->port_number + 1; purge_command.what = rxtx; return firm_send_command(port, WHITEHEAT_PURGE, (__u8 *)&purge_command, sizeof(purge_command)); @@ -806,7 +799,7 @@ { struct whiteheat_simple get_dr_command; - get_dr_command.port = port->number - port->serial->minor + 1; + get_dr_command.port = port->port_number + 1; return firm_send_command(port, WHITEHEAT_GET_DTR_RTS, (__u8 *)&get_dr_command, sizeof(get_dr_command)); } @@ -816,7 +809,7 @@ { struct whiteheat_simple close_command; - close_command.port = port->number - port->serial->minor + 1; + close_command.port = port->port_number + 1; return firm_send_command(port, WHITEHEAT_REPORT_TX_DONE, (__u8 *)&close_command, sizeof(close_command)); }