Commit c572a217 authored by Richard Leitner's avatar Richard Leitner Committed by Felipe Balbi

usb: gadget: serial: remove PREFIX macro

Remove the ttyGS PREFIX macro from u_serial.c and replace all occurences with
the hardcoded ttyGS string.

This macro was mostly used in a few debug/warning messages and a lot of
hardcoded ttyGS existed beneath. It may have been used for renaming the
tty, but if done so most debug messages would have ignored this.

Due to the fact the usage of this PREFIX in all debug calls would have
resulted in a hard to read/grep code it is removed completely.
Signed-off-by: default avatarRichard Leitner <richard.leitner@skidata.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent b8b0ea51
...@@ -55,11 +55,8 @@ ...@@ -55,11 +55,8 @@
* for a telephone or fax link. And ttyGS2 might be something that just * for a telephone or fax link. And ttyGS2 might be something that just
* needs a simple byte stream interface for some messaging protocol that * needs a simple byte stream interface for some messaging protocol that
* is managed in userspace ... OBEX, PTP, and MTP have been mentioned. * is managed in userspace ... OBEX, PTP, and MTP have been mentioned.
*/ *
*
#define PREFIX "ttyGS"
/*
* gserial is the lifecycle interface, used by USB functions * gserial is the lifecycle interface, used by USB functions
* gs_port is the I/O nexus, used by the tty driver * gs_port is the I/O nexus, used by the tty driver
* tty_struct links to the tty/filesystem framework * tty_struct links to the tty/filesystem framework
...@@ -385,9 +382,9 @@ __acquires(&port->port_lock) ...@@ -385,9 +382,9 @@ __acquires(&port->port_lock)
list_del(&req->list); list_del(&req->list);
req->zero = (gs_buf_data_avail(&port->port_write_buf) == 0); req->zero = (gs_buf_data_avail(&port->port_write_buf) == 0);
pr_vdebug(PREFIX "%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n", pr_vdebug("ttyGS%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n",
port->port_num, len, *((u8 *)req->buf), port->port_num, len, *((u8 *)req->buf),
*((u8 *)req->buf+1), *((u8 *)req->buf+2)); *((u8 *)req->buf+1), *((u8 *)req->buf+2));
/* Drop lock while we call out of driver; completions /* Drop lock while we call out of driver; completions
* could be issued while we do so. Disconnection may * could be issued while we do so. Disconnection may
...@@ -503,13 +500,13 @@ static void gs_rx_push(unsigned long _port) ...@@ -503,13 +500,13 @@ static void gs_rx_push(unsigned long _port)
switch (req->status) { switch (req->status) {
case -ESHUTDOWN: case -ESHUTDOWN:
disconnect = true; disconnect = true;
pr_vdebug(PREFIX "%d: shutdown\n", port->port_num); pr_vdebug("ttyGS%d: shutdown\n", port->port_num);
break; break;
default: default:
/* presumably a transient fault */ /* presumably a transient fault */
pr_warning(PREFIX "%d: unexpected RX status %d\n", pr_warn("ttyGS%d: unexpected RX status %d\n",
port->port_num, req->status); port->port_num, req->status);
/* FALLTHROUGH */ /* FALLTHROUGH */
case 0: case 0:
/* normal completion */ /* normal completion */
...@@ -537,9 +534,8 @@ static void gs_rx_push(unsigned long _port) ...@@ -537,9 +534,8 @@ static void gs_rx_push(unsigned long _port)
if (count != size) { if (count != size) {
/* stop pushing; TTY layer can't handle more */ /* stop pushing; TTY layer can't handle more */
port->n_read += count; port->n_read += count;
pr_vdebug(PREFIX "%d: rx block %d/%d\n", pr_vdebug("ttyGS%d: rx block %d/%d\n",
port->port_num, port->port_num, count, req->actual);
count, req->actual);
break; break;
} }
port->n_read = 0; port->n_read = 0;
...@@ -569,7 +565,7 @@ static void gs_rx_push(unsigned long _port) ...@@ -569,7 +565,7 @@ static void gs_rx_push(unsigned long _port)
if (do_push) if (do_push)
tasklet_schedule(&port->push); tasklet_schedule(&port->push);
else else
pr_warning(PREFIX "%d: RX not scheduled?\n", pr_warn("ttyGS%d: RX not scheduled?\n",
port->port_num); port->port_num);
} }
} }
...@@ -985,7 +981,7 @@ static void gs_unthrottle(struct tty_struct *tty) ...@@ -985,7 +981,7 @@ static void gs_unthrottle(struct tty_struct *tty)
* read queue backs up enough we'll be NAKing OUT packets. * read queue backs up enough we'll be NAKing OUT packets.
*/ */
tasklet_schedule(&port->push); tasklet_schedule(&port->push);
pr_vdebug(PREFIX "%d: unthrottle\n", port->port_num); pr_vdebug("ttyGS%d: unthrottle\n", port->port_num);
} }
spin_unlock_irqrestore(&port->port_lock, flags); spin_unlock_irqrestore(&port->port_lock, flags);
} }
...@@ -1295,7 +1291,7 @@ static int userial_init(void) ...@@ -1295,7 +1291,7 @@ static int userial_init(void)
return -ENOMEM; return -ENOMEM;
gs_tty_driver->driver_name = "g_serial"; gs_tty_driver->driver_name = "g_serial";
gs_tty_driver->name = PREFIX; gs_tty_driver->name = "ttyGS";
/* uses dynamically assigned dev_t values */ /* uses dynamically assigned dev_t values */
gs_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; gs_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment