diff options
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 2457165304cb..b19e16a539e2 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #include <linux/serial.h> | 66 | #include <linux/serial.h> |
67 | #include <linux/delay.h> | 67 | #include <linux/delay.h> |
68 | #include <linux/uaccess.h> | 68 | #include <linux/uaccess.h> |
69 | #include <asm/unaligned.h> | ||
69 | 70 | ||
70 | #include "cypress_m8.h" | 71 | #include "cypress_m8.h" |
71 | 72 | ||
@@ -376,7 +377,7 @@ static int cypress_serial_control(struct tty_struct *tty, | |||
376 | __func__, new_baudrate); | 377 | __func__, new_baudrate); |
377 | 378 | ||
378 | /* fill the feature_buffer with new configuration */ | 379 | /* fill the feature_buffer with new configuration */ |
379 | *((u32 *)feature_buffer) = cpu_to_le32(new_baudrate); | 380 | put_unaligned_le32(new_baudrate, feature_buffer); |
380 | feature_buffer[4] |= data_bits; /* assign data bits in 2 bit space ( max 3 ) */ | 381 | feature_buffer[4] |= data_bits; /* assign data bits in 2 bit space ( max 3 ) */ |
381 | /* 1 bit gap */ | 382 | /* 1 bit gap */ |
382 | feature_buffer[4] |= (stop_bits << 3); /* assign stop bits in 1 bit space */ | 383 | feature_buffer[4] |= (stop_bits << 3); /* assign stop bits in 1 bit space */ |
@@ -453,7 +454,7 @@ static int cypress_serial_control(struct tty_struct *tty, | |||
453 | /* store the config in one byte, and later | 454 | /* store the config in one byte, and later |
454 | use bit masks to check values */ | 455 | use bit masks to check values */ |
455 | priv->current_config = feature_buffer[4]; | 456 | priv->current_config = feature_buffer[4]; |
456 | priv->baud_rate = le32_to_cpup((u32 *)feature_buffer); | 457 | priv->baud_rate = get_unaligned_le32(feature_buffer); |
457 | spin_unlock_irqrestore(&priv->lock, flags); | 458 | spin_unlock_irqrestore(&priv->lock, flags); |
458 | } | 459 | } |
459 | } | 460 | } |