[PATCH] pl2303: fix the upper baud rate limit check for type_0/1 chips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes the following regression that has been introduced recently with commit b2d6d98fc7:
With type_0 and type_1 chips
- all baud rates < 1228800 baud are rounded up to 1228800 baud
- the device silently runs at 9600 baud for all baud rates > 1228800 baud 

Signed-off-by: Frank Schäfer <fschaefer.oss@xxxxxxxxxxxxxx>
---
 drivers/usb/serial/pl2303.c |    2 +-
 1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 299a0ff..1e6de4c 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -303,7 +303,7 @@ static void pl2303_encode_baudrate(struct tty_struct *tty,
 
 	/* type_0, type_1 only support up to 1228800 baud */
 	if (spriv->type != HX)
-		baud = max_t(int, baud, 1228800);
+		baud = min_t(int, baud, 1228800);
 
 	if (baud <= 115200) {
 		put_unaligned_le32(baud, buf);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux