diff options
Diffstat (limited to 'drivers/media/video/gspca/ov519.c')
-rw-r--r-- | drivers/media/video/gspca/ov519.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index ba245bafcd6f..08d99c3b78e2 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -24,8 +24,8 @@ | |||
24 | 24 | ||
25 | #include "gspca.h" | 25 | #include "gspca.h" |
26 | 26 | ||
27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5) | 27 | #define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 7) |
28 | static const char version[] = "2.1.5"; | 28 | static const char version[] = "2.1.7"; |
29 | 29 | ||
30 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); | 30 | MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); |
31 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); | 31 | MODULE_DESCRIPTION("OV519 USB Camera Driver"); |
@@ -282,15 +282,14 @@ static unsigned char ov7670_abs_to_sm(unsigned char v) | |||
282 | static int reg_w(struct sd *sd, __u16 index, __u8 value) | 282 | static int reg_w(struct sd *sd, __u16 index, __u8 value) |
283 | { | 283 | { |
284 | int ret; | 284 | int ret; |
285 | __u8 data; | ||
286 | 285 | ||
287 | data = value; | 286 | sd->gspca_dev.usb_buf[0] = value; |
288 | ret = usb_control_msg(sd->gspca_dev.dev, | 287 | ret = usb_control_msg(sd->gspca_dev.dev, |
289 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), | 288 | usb_sndctrlpipe(sd->gspca_dev.dev, 0), |
290 | 1, /* REQ_IO (ov518/519) */ | 289 | 1, /* REQ_IO (ov518/519) */ |
291 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 290 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
292 | 0, index, | 291 | 0, index, |
293 | &data, 1, 500); | 292 | sd->gspca_dev.usb_buf, 1, 500); |
294 | if (ret < 0) | 293 | if (ret < 0) |
295 | PDEBUG(D_ERR, "Write reg [%02x] %02x failed", index, value); | 294 | PDEBUG(D_ERR, "Write reg [%02x] %02x failed", index, value); |
296 | return ret; | 295 | return ret; |
@@ -301,16 +300,15 @@ static int reg_w(struct sd *sd, __u16 index, __u8 value) | |||
301 | static int reg_r(struct sd *sd, __u16 index) | 300 | static int reg_r(struct sd *sd, __u16 index) |
302 | { | 301 | { |
303 | int ret; | 302 | int ret; |
304 | __u8 data; | ||
305 | 303 | ||
306 | ret = usb_control_msg(sd->gspca_dev.dev, | 304 | ret = usb_control_msg(sd->gspca_dev.dev, |
307 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), | 305 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), |
308 | 1, /* REQ_IO */ | 306 | 1, /* REQ_IO */ |
309 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 307 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
310 | 0, index, &data, 1, 500); | 308 | 0, index, sd->gspca_dev.usb_buf, 1, 500); |
311 | 309 | ||
312 | if (ret >= 0) | 310 | if (ret >= 0) |
313 | ret = data; | 311 | ret = sd->gspca_dev.usb_buf[0]; |
314 | else | 312 | else |
315 | PDEBUG(D_ERR, "Read reg [0x%02x] failed", index); | 313 | PDEBUG(D_ERR, "Read reg [0x%02x] failed", index); |
316 | return ret; | 314 | return ret; |
@@ -321,16 +319,15 @@ static int reg_r8(struct sd *sd, | |||
321 | __u16 index) | 319 | __u16 index) |
322 | { | 320 | { |
323 | int ret; | 321 | int ret; |
324 | __u8 buf[8]; | ||
325 | 322 | ||
326 | ret = usb_control_msg(sd->gspca_dev.dev, | 323 | ret = usb_control_msg(sd->gspca_dev.dev, |
327 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), | 324 | usb_rcvctrlpipe(sd->gspca_dev.dev, 0), |
328 | 1, /* REQ_IO */ | 325 | 1, /* REQ_IO */ |
329 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 326 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
330 | 0, index, &buf[0], 8, 500); | 327 | 0, index, sd->gspca_dev.usb_buf, 8, 500); |
331 | 328 | ||
332 | if (ret >= 0) | 329 | if (ret >= 0) |
333 | ret = buf[0]; | 330 | ret = sd->gspca_dev.usb_buf[0]; |
334 | else | 331 | else |
335 | PDEBUG(D_ERR, "Read reg 8 [0x%02x] failed", index); | 332 | PDEBUG(D_ERR, "Read reg 8 [0x%02x] failed", index); |
336 | return ret; | 333 | return ret; |