Commit fd54a99a authored by Johan Hovold's avatar Johan Hovold

USB: serial: ftdi_sio: use non-underscore fixed types

Replace all __u types with their u counterparts throughout the driver
(whose structures are not exported to user space).
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 5ada9842
...@@ -54,7 +54,7 @@ struct ftdi_private { ...@@ -54,7 +54,7 @@ struct ftdi_private {
int custom_divisor; /* custom_divisor kludge, this is for int custom_divisor; /* custom_divisor kludge, this is for
baud_base (different from what goes to the baud_base (different from what goes to the
chip!) */ chip!) */
__u16 last_set_data_urb_value ; u16 last_set_data_urb_value;
/* the last data state set - needed for doing /* the last data state set - needed for doing
* a break * a break
*/ */
...@@ -62,7 +62,7 @@ struct ftdi_private { ...@@ -62,7 +62,7 @@ struct ftdi_private {
unsigned long last_dtr_rts; /* saved modem control outputs */ unsigned long last_dtr_rts; /* saved modem control outputs */
char prev_status; /* Used for TIOCMIWAIT */ char prev_status; /* Used for TIOCMIWAIT */
char transmit_empty; /* If transmitter is empty or not */ char transmit_empty; /* If transmitter is empty or not */
__u16 interface; /* FT2232C, FT2232H or FT4232H port interface u16 interface; /* FT2232C, FT2232H or FT4232H port interface
(0 for FT232/245) */ (0 for FT232/245) */
speed_t force_baud; /* if non-zero, force the baud rate to speed_t force_baud; /* if non-zero, force the baud rate to
...@@ -1063,10 +1063,10 @@ static int ftdi_get_modem_status(struct usb_serial_port *port, ...@@ -1063,10 +1063,10 @@ static int ftdi_get_modem_status(struct usb_serial_port *port,
static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base);
static unsigned short int ftdi_232am_baud_to_divisor(int baud); static unsigned short int ftdi_232am_baud_to_divisor(int baud);
static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base); static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base);
static __u32 ftdi_232bm_baud_to_divisor(int baud); static u32 ftdi_232bm_baud_to_divisor(int baud);
static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base); static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base);
static __u32 ftdi_2232h_baud_to_divisor(int baud); static u32 ftdi_2232h_baud_to_divisor(int baud);
static struct usb_serial_driver ftdi_sio_device = { static struct usb_serial_driver ftdi_sio_device = {
.driver = { .driver = {
...@@ -1136,14 +1136,14 @@ static unsigned short int ftdi_232am_baud_to_divisor(int baud) ...@@ -1136,14 +1136,14 @@ static unsigned short int ftdi_232am_baud_to_divisor(int baud)
return ftdi_232am_baud_base_to_divisor(baud, 48000000); return ftdi_232am_baud_base_to_divisor(baud, 48000000);
} }
static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
{ {
static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 };
__u32 divisor; u32 divisor;
/* divisor shifted 3 bits to the left */ /* divisor shifted 3 bits to the left */
int divisor3 = base / 2 / baud; int divisor3 = base / 2 / baud;
divisor = divisor3 >> 3; divisor = divisor3 >> 3;
divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; divisor |= (u32)divfrac[divisor3 & 0x7] << 14;
/* Deal with special cases for highest baud rates. */ /* Deal with special cases for highest baud rates. */
if (divisor == 1) if (divisor == 1)
divisor = 0; divisor = 0;
...@@ -1152,22 +1152,22 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base) ...@@ -1152,22 +1152,22 @@ static __u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
return divisor; return divisor;
} }
static __u32 ftdi_232bm_baud_to_divisor(int baud) static u32 ftdi_232bm_baud_to_divisor(int baud)
{ {
return ftdi_232bm_baud_base_to_divisor(baud, 48000000); return ftdi_232bm_baud_base_to_divisor(baud, 48000000);
} }
static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
{ {
static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 }; static const unsigned char divfrac[8] = { 0, 3, 2, 4, 1, 5, 6, 7 };
__u32 divisor; u32 divisor;
int divisor3; int divisor3;
/* hi-speed baud rate is 10-bit sampling instead of 16-bit */ /* hi-speed baud rate is 10-bit sampling instead of 16-bit */
divisor3 = base * 8 / (baud * 10); divisor3 = base * 8 / (baud * 10);
divisor = divisor3 >> 3; divisor = divisor3 >> 3;
divisor |= (__u32)divfrac[divisor3 & 0x7] << 14; divisor |= (u32)divfrac[divisor3 & 0x7] << 14;
/* Deal with special cases for highest baud rates. */ /* Deal with special cases for highest baud rates. */
if (divisor == 1) if (divisor == 1)
divisor = 0; divisor = 0;
...@@ -1182,7 +1182,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base) ...@@ -1182,7 +1182,7 @@ static __u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
return divisor; return divisor;
} }
static __u32 ftdi_2232h_baud_to_divisor(int baud) static u32 ftdi_2232h_baud_to_divisor(int baud)
{ {
return ftdi_2232h_baud_base_to_divisor(baud, 120000000); return ftdi_2232h_baud_base_to_divisor(baud, 120000000);
} }
...@@ -1236,12 +1236,12 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, ...@@ -1236,12 +1236,12 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set,
} }
static __u32 get_ftdi_divisor(struct tty_struct *tty, static u32 get_ftdi_divisor(struct tty_struct *tty,
struct usb_serial_port *port) struct usb_serial_port *port)
{ {
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
struct device *dev = &port->dev; struct device *dev = &port->dev;
__u32 div_value = 0; u32 div_value = 0;
int div_okay = 1; int div_okay = 1;
int baud; int baud;
...@@ -1299,7 +1299,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, ...@@ -1299,7 +1299,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
case FT232RL: /* FT232RL chip */ case FT232RL: /* FT232RL chip */
case FTX: /* FT-X series */ case FTX: /* FT-X series */
if (baud <= 3000000) { if (baud <= 3000000) {
__u16 product_id = le16_to_cpu( u16 product_id = le16_to_cpu(
port->serial->dev->descriptor.idProduct); port->serial->dev->descriptor.idProduct);
if (((product_id == FTDI_NDI_HUC_PID) || if (((product_id == FTDI_NDI_HUC_PID) ||
(product_id == FTDI_NDI_SPECTRA_SCU_PID) || (product_id == FTDI_NDI_SPECTRA_SCU_PID) ||
...@@ -1346,19 +1346,19 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, ...@@ -1346,19 +1346,19 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty,
static int change_speed(struct tty_struct *tty, struct usb_serial_port *port) static int change_speed(struct tty_struct *tty, struct usb_serial_port *port)
{ {
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
__u16 urb_value; u16 urb_value;
__u16 urb_index; u16 urb_index;
__u32 urb_index_value; u32 urb_index_value;
int rv; int rv;
urb_index_value = get_ftdi_divisor(tty, port); urb_index_value = get_ftdi_divisor(tty, port);
urb_value = (__u16)urb_index_value; urb_value = (u16)urb_index_value;
urb_index = (__u16)(urb_index_value >> 16); urb_index = (u16)(urb_index_value >> 16);
if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) || if ((priv->chip_type == FT2232C) || (priv->chip_type == FT2232H) ||
(priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) { (priv->chip_type == FT4232H) || (priv->chip_type == FT232H)) {
/* Probably the BM type needs the MSB of the encoded fractional /* Probably the BM type needs the MSB of the encoded fractional
* divider also moved like for the chips above. Any infos? */ * divider also moved like for the chips above. Any infos? */
urb_index = (__u16)((urb_index << 8) | priv->interface); urb_index = (u16)((urb_index << 8) | priv->interface);
} }
rv = usb_control_msg(port->serial->dev, rv = usb_control_msg(port->serial->dev,
...@@ -2140,7 +2140,7 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state) ...@@ -2140,7 +2140,7 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
{ {
struct usb_serial_port *port = tty->driver_data; struct usb_serial_port *port = tty->driver_data;
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
__u16 urb_value; u16 urb_value;
/* break_state = -1 to turn on break, and 0 to turn off break */ /* break_state = -1 to turn on break, and 0 to turn off break */
/* see drivers/char/tty_io.c to see it used */ /* see drivers/char/tty_io.c to see it used */
...@@ -2192,7 +2192,7 @@ static void ftdi_set_termios(struct tty_struct *tty, ...@@ -2192,7 +2192,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
struct ftdi_private *priv = usb_get_serial_port_data(port); struct ftdi_private *priv = usb_get_serial_port_data(port);
struct ktermios *termios = &tty->termios; struct ktermios *termios = &tty->termios;
unsigned int cflag = termios->c_cflag; unsigned int cflag = termios->c_cflag;
__u16 urb_value; /* will hold the new flags */ u16 urb_value; /* will hold the new flags */
/* Added for xon/xoff support */ /* Added for xon/xoff support */
unsigned int iflag = termios->c_iflag; unsigned int iflag = termios->c_iflag;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment