Skip to content

Commit

Permalink
USB: cypress_m8: use put_unaligned_le32() where necessary
Browse files Browse the repository at this point in the history
Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 5be796f commit 0f2c2d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <linux/serial.h>
#include <linux/delay.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>

#include "cypress_m8.h"

Expand Down Expand Up @@ -376,7 +377,7 @@ static int cypress_serial_control(struct tty_struct *tty,
__func__, new_baudrate);

/* fill the feature_buffer with new configuration */
*((u32 *)feature_buffer) = cpu_to_le32(new_baudrate);
put_unaligned_le32(new_baudrate, feature_buffer);
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 */
Expand Down Expand Up @@ -453,7 +454,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 = le32_to_cpup((u32 *)feature_buffer);
priv->baud_rate = get_unaligned_le32(feature_buffer);
spin_unlock_irqrestore(&priv->lock, flags);
}
}
Expand Down

0 comments on commit 0f2c2d7

Please sign in to comment.