diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2008-11-11 12:04:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:36 -0500 |
commit | 4d3939f6eecb1c3330a34e0bc95a6b8529207b88 (patch) | |
tree | 1c2ee323e366bbb4dcea1ee3db8f20e7257ded69 /drivers/media/video/uvc | |
parent | 23159a0bfcfb329cf68c7a7259e688494273bb7f (diff) |
V4L/DVB (9659): uvcvideo: Use {get|set}_unaligned_le32 macros
Replace combination of endianess conversion and unaligned access macros with
{get|set}_unaligned_*.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 4af94707ef69..e07bee98a00a 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c | |||
@@ -142,14 +142,11 @@ static int uvc_get_video_ctrl(struct uvc_video_device *video, | |||
142 | ctrl->wCompQuality = le16_to_cpup((__le16 *)&data[12]); | 142 | ctrl->wCompQuality = le16_to_cpup((__le16 *)&data[12]); |
143 | ctrl->wCompWindowSize = le16_to_cpup((__le16 *)&data[14]); | 143 | ctrl->wCompWindowSize = le16_to_cpup((__le16 *)&data[14]); |
144 | ctrl->wDelay = le16_to_cpup((__le16 *)&data[16]); | 144 | ctrl->wDelay = le16_to_cpup((__le16 *)&data[16]); |
145 | ctrl->dwMaxVideoFrameSize = | 145 | ctrl->dwMaxVideoFrameSize = get_unaligned_le32(&data[18]); |
146 | le32_to_cpu(get_unaligned((__le32 *)&data[18])); | 146 | ctrl->dwMaxPayloadTransferSize = get_unaligned_le32(&data[22]); |
147 | ctrl->dwMaxPayloadTransferSize = | ||
148 | le32_to_cpu(get_unaligned((__le32 *)&data[22])); | ||
149 | 147 | ||
150 | if (size == 34) { | 148 | if (size == 34) { |
151 | ctrl->dwClockFrequency = | 149 | ctrl->dwClockFrequency = get_unaligned_le32(&data[26]); |
152 | le32_to_cpu(get_unaligned((__le32 *)&data[26])); | ||
153 | ctrl->bmFramingInfo = data[30]; | 150 | ctrl->bmFramingInfo = data[30]; |
154 | ctrl->bPreferedVersion = data[31]; | 151 | ctrl->bPreferedVersion = data[31]; |
155 | ctrl->bMinVersion = data[32]; | 152 | ctrl->bMinVersion = data[32]; |
@@ -197,14 +194,11 @@ static int uvc_set_video_ctrl(struct uvc_video_device *video, | |||
197 | /* Note: Some of the fields below are not required for IN devices (see | 194 | /* Note: Some of the fields below are not required for IN devices (see |
198 | * UVC spec, 4.3.1.1), but we still copy them in case support for OUT | 195 | * UVC spec, 4.3.1.1), but we still copy them in case support for OUT |
199 | * devices is added in the future. */ | 196 | * devices is added in the future. */ |
200 | put_unaligned(cpu_to_le32(ctrl->dwMaxVideoFrameSize), | 197 | put_unaligned_le32(ctrl->dwMaxVideoFrameSize, &data[18]); |
201 | (__le32 *)&data[18]); | 198 | put_unaligned_le32(ctrl->dwMaxPayloadTransferSize, &data[22]); |
202 | put_unaligned(cpu_to_le32(ctrl->dwMaxPayloadTransferSize), | ||
203 | (__le32 *)&data[22]); | ||
204 | 199 | ||
205 | if (size == 34) { | 200 | if (size == 34) { |
206 | put_unaligned(cpu_to_le32(ctrl->dwClockFrequency), | 201 | put_unaligned_le32(ctrl->dwClockFrequency, &data[26]); |
207 | (__le32 *)&data[26]); | ||
208 | data[30] = ctrl->bmFramingInfo; | 202 | data[30] = ctrl->bmFramingInfo; |
209 | data[31] = ctrl->bPreferedVersion; | 203 | data[31] = ctrl->bPreferedVersion; |
210 | data[32] = ctrl->bMinVersion; | 204 | data[32] = ctrl->bMinVersion; |