Enforce any baud-rate limits before doing table lookup.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
dev_dbg(&port->dev, "baud requested = %u\n", baud);
if (!baud)
return;
+
+ if (spriv->type->max_baud_rate)
+ baud = min_t(speed_t, baud, spriv->type->max_baud_rate);
/*
* Set baud rate to nearest supported value.
*
*/
baud = pl2303_get_supported_baud_rate(baud);
- if (spriv->type->max_baud_rate)
- baud = min_t(speed_t, baud, spriv->type->max_baud_rate);
-
if (baud <= 115200) {
put_unaligned_le32(baud, buf);
} else {