diff options
author | Johan Hovold <jhovold@gmail.com> | 2009-12-31 10:48:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:54:00 -0500 |
commit | 0f2c2d7bbb51338fdcda9670795a6c6e348622d9 (patch) | |
tree | 320646ba416107e16d9640a7bdf92ce5261d9f21 /drivers | |
parent | 5be796f0b842c5852d7397a82f8ebd6be8451872 (diff) |
USB: cypress_m8: use put_unaligned_le32() where necessary
Cc: Lonnie Mendez <dignome@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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 | } |