From f6c259a39fd7bb8db6661690976a0f05d12b707d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Gl=C3=B6ckner?= Date: Tue, 11 Jan 2011 00:42:14 +0100 Subject: [PATCH] USB: ftdi_sio: fix resolution of 2232H baud rate dividers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The 2232H high speed baud rates also support fractional baud rate divisors, but when the performing the divisions before the multiplication, the fractional bits are lost. Signed-off-by: Daniel Glöckner Acked-by: Mark Adamson Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index a2668d089260..71a0f99023bd 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -955,7 +955,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) int divisor3; /* hi-speed baud rate is 10-bit sampling instead of 16-bit */ - divisor3 = (base / 10 / baud) * 8; + divisor3 = base * 8 / (baud * 10); divisor = divisor3 >> 3; divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; -- 2.11.0