USB: cypress_m8: fix endianess bug
authorJohan Hovold <jhovold@gmail.com>
Mon, 28 Dec 2009 22:01:49 +0000 (23:01 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Mar 2010 22:53:52 +0000 (14:53 -0800)
Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/cypress_m8.c

index 1ce1a3a..2457165 100644 (file)
@@ -376,7 +376,7 @@ static int cypress_serial_control(struct tty_struct *tty,
                                        __func__, new_baudrate);
 
                /* fill the feature_buffer with new configuration */
-               *((u_int32_t *)feature_buffer) = new_baudrate;
+               *((u32 *)feature_buffer) = cpu_to_le32(new_baudrate);
                feature_buffer[4] |= data_bits;   /* assign data bits in 2 bit space ( max 3 ) */
                /* 1 bit gap */
                feature_buffer[4] |= (stop_bits << 3);   /* assign stop bits in 1 bit space */
@@ -453,7 +453,7 @@ static int cypress_serial_control(struct tty_struct *tty,
                        /* store the config in one byte, and later
                           use bit masks to check values */
                        priv->current_config = feature_buffer[4];
-                       priv->baud_rate = *((u_int32_t *)feature_buffer);
+                       priv->baud_rate = le32_to_cpup((u32 *)feature_buffer);
                        spin_unlock_irqrestore(&priv->lock, flags);
                }
        }