Commit 2805eb13 authored by Mike Frysinger's avatar Mike Frysinger Committed by Greg Kroah-Hartman

USB: cypress_m8: unify confusing new baudrate check

The current code has a confusing duplicate new_baudrate init when setting
the serial parameters.  So just combine the if statement checks to avoid
this.
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 64319dd7
......@@ -352,12 +352,9 @@ static int cypress_serial_control(struct tty_struct *tty,
switch (cypress_request_type) {
case CYPRESS_SET_CONFIG:
new_baudrate = priv->baud_rate;
/* 0 means 'Hang up' so doesn't change the true bit rate */
if (baud_rate == 0)
new_baudrate = priv->baud_rate;
/* Change of speed ? */
else if (baud_rate != priv->baud_rate) {
if (baud_rate && baud_rate != priv->baud_rate) {
dbg("%s - baud rate is changing", __func__);
retval = analyze_baud_rate(port, baud_rate);
if (retval >= 0) {
......
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