Skip to content

Commit c8345c0

Browse files
committed
USB: serial: kl5kusb105: drop line-status helper
Drop the line-status conversion helper and do the conversion in place instead. Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent 2e0b78d commit c8345c0

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

drivers/usb/serial/kl5kusb105.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,24 +147,12 @@ static int klsi_105_chg_port_settings(struct usb_serial_port *port,
147147
return rc;
148148
}
149149

150-
/* translate a 16-bit status value from the device to linux's TIO bits */
151-
static unsigned long klsi_105_status2linestate(const __u16 status)
152-
{
153-
unsigned long res = 0;
154-
155-
res = ((status & KL5KUSB105A_DSR) ? TIOCM_DSR : 0)
156-
| ((status & KL5KUSB105A_CTS) ? TIOCM_CTS : 0)
157-
;
158-
159-
return res;
160-
}
161-
162150
/*
163151
* Read line control via vendor command and return result through
164-
* *line_state_p
152+
* the state pointer.
165153
*/
166154
static int klsi_105_get_line_state(struct usb_serial_port *port,
167-
unsigned long *line_state_p)
155+
unsigned long *state)
168156
{
169157
u16 status;
170158
int rc;
@@ -186,7 +174,8 @@ static int klsi_105_get_line_state(struct usb_serial_port *port,
186174

187175
dev_dbg(&port->dev, "read status %04x\n", status);
188176

189-
*line_state_p = klsi_105_status2linestate(status);
177+
*state = ((status & KL5KUSB105A_DSR) ? TIOCM_DSR : 0) |
178+
((status & KL5KUSB105A_CTS) ? TIOCM_CTS : 0);
190179

191180
return 0;
192181
}

0 commit comments

Comments
 (0)