]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/serial/oti6858.c
usb-serial: Use ftdi_sio driver for RATOC REX-USB60F
[karo-tx-linux.git] / drivers / usb / serial / oti6858.c
index 87f33e06301ce1d47ae6285d70eaf7017b70c561..a9625c180dc3502206d2d967224a1d6ea31d2bf5 100644 (file)
@@ -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);
        }
 
@@ -871,7 +872,7 @@ static void oti6858_shutdown(struct usb_serial *serial)
 
 static void oti6858_read_int_callback(struct urb *urb)
 {
-       struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
+       struct usb_serial_port *port =  urb->context;
        struct oti6858_private *priv = usb_get_serial_port_data(port);
        int transient = 0, can_recv = 0, resubmit = 1;
        int status = urb->status;
@@ -985,7 +986,7 @@ static void oti6858_read_int_callback(struct urb *urb)
 
 static void oti6858_read_bulk_callback(struct urb *urb)
 {
-       struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
+       struct usb_serial_port *port =  urb->context;
        struct oti6858_private *priv = usb_get_serial_port_data(port);
        struct tty_struct *tty;
        unsigned char *data = urb->transfer_buffer;
@@ -1038,7 +1039,7 @@ static void oti6858_read_bulk_callback(struct urb *urb)
 
 static void oti6858_write_bulk_callback(struct urb *urb)
 {
-       struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
+       struct usb_serial_port *port =  urb->context;
        struct oti6858_private *priv = usb_get_serial_port_data(port);
        int status = urb->status;
        int result;