summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/oti6858.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-04-28 07:00:16 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 10:03:31 -0700
commitfd05e720099e8eeddb378305d1a41c1445344b91 (patch)
treed617918be290b47b35822bc3cf21c8f01dde5dd2 /drivers/usb/serial/oti6858.c
parent01d7b369887b6feb7c9ce2b20988fafe3f70841c (diff)
drivers/usb annotations and fixes
* endianness annotations * endianness fixes * missing get_unaligned/put_unaligned It's pretty much all over the place, changes to different files are independent. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Serial-parts-Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/oti6858.c')
-rw-r--r--drivers/usb/serial/oti6858.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index d92bb6501c84..a9625c180dc3 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -98,7 +98,7 @@ struct oti6858_buf {
/* format of the control packet */
struct oti6858_control_pkt {
- u16 divisor; /* baud rate = 96000000 / (16 * divisor), LE */
+ __le16 divisor; /* baud rate = 96000000 / (16 * divisor), LE */
#define OTI6858_MAX_BAUD_RATE 3000000
u8 frame_fmt;
#define FMT_STOP_BITS_MASK 0xc0
@@ -211,7 +211,7 @@ struct oti6858_private {
struct delayed_work delayed_write_work;
struct {
- u16 divisor;
+ __le16 divisor;
u8 frame_fmt;
u8 control;
} pending_setup;
@@ -450,7 +450,7 @@ static void oti6858_set_termios(struct usb_serial_port *port,
unsigned long flags;
unsigned int cflag;
u8 frame_fmt, control;
- u16 divisor;
+ __le16 divisor;
int br;
dbg("%s(port = %d)", __func__, port->number);
@@ -505,11 +505,12 @@ static void oti6858_set_termios(struct usb_serial_port *port,
divisor = 0;
} else {
int real_br;
+ int new_divisor;
br = min(br, OTI6858_MAX_BAUD_RATE);
- divisor = (96000000 + 8 * br) / (16 * br);
- real_br = 96000000 / (16 * divisor);
- divisor = cpu_to_le16(divisor);
+ new_divisor = (96000000 + 8 * br) / (16 * br);
+ real_br = 96000000 / (16 * new_divisor);
+ divisor = cpu_to_le16(new_divisor);
tty_encode_baud_rate(port->tty, real_br, real_br);
}