diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-12-18 16:33:02 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:53:24 -0500 |
commit | 2805eb13c3b5be7bd6ec7380502bc054b570afd5 (patch) | |
tree | 2c34f1d6ef6a5bcd4e38d851376318fce0410f54 /drivers/usb/serial/cypress_m8.c | |
parent | 64319dd74f3d45f13b6d0aafa91104eb105f1829 (diff) |
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: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/cypress_m8.c')
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 8c69bc53a083..47a18193abad 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -352,15 +352,12 @@ static int cypress_serial_control(struct tty_struct *tty, | |||
352 | 352 | ||
353 | switch (cypress_request_type) { | 353 | switch (cypress_request_type) { |
354 | case CYPRESS_SET_CONFIG: | 354 | case CYPRESS_SET_CONFIG: |
355 | new_baudrate = priv->baud_rate; | ||
356 | /* 0 means 'Hang up' so doesn't change the true bit rate */ | 355 | /* 0 means 'Hang up' so doesn't change the true bit rate */ |
357 | if (baud_rate == 0) | 356 | new_baudrate = priv->baud_rate; |
358 | new_baudrate = priv->baud_rate; | 357 | if (baud_rate && baud_rate != priv->baud_rate) { |
359 | /* Change of speed ? */ | ||
360 | else if (baud_rate != priv->baud_rate) { | ||
361 | dbg("%s - baud rate is changing", __func__); | 358 | dbg("%s - baud rate is changing", __func__); |
362 | retval = analyze_baud_rate(port, baud_rate); | 359 | retval = analyze_baud_rate(port, baud_rate); |
363 | if (retval >= 0) { | 360 | if (retval >= 0) { |
364 | new_baudrate = retval; | 361 | new_baudrate = retval; |
365 | dbg("%s - New baud rate set to %d", | 362 | dbg("%s - New baud rate set to %d", |
366 | __func__, new_baudrate); | 363 | __func__, new_baudrate); |