aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/spca505.c
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-07-04 10:16:16 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:16:53 -0400
commita5ae2062252e697d38e53dbbeb91460252208914 (patch)
tree38706e9f36e2d93cd3dee8eea639bb74a17b3efa /drivers/media/video/gspca/spca505.c
parent54ab92ca05550550bcec2462de2605f35d079b66 (diff)
V4L/DVB (8195): gspca: Input buffer overwritten in spca561 + cleanup code.
spca561: Input buffer may be changed on reg write. (all sd): Cleanup code, 'const' added. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca/spca505.c')
-rw-r--r--drivers/media/video/gspca/spca505.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c
index d8ff121c2c5a..30d174fc4b9c 100644
--- a/drivers/media/video/gspca/spca505.c
+++ b/drivers/media/video/gspca/spca505.c
@@ -23,8 +23,8 @@
23 23
24#include "gspca.h" 24#include "gspca.h"
25 25
26#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 0) 26#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 4)
27static const char version[] = "2.1.0"; 27static const char version[] = "2.1.4";
28 28
29MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>"); 29MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
30MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver"); 30MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver");
@@ -91,7 +91,7 @@ static struct cam_mode vga_mode[] = {
91/* 91/*
92 * Data to initialize a SPCA505. Common to the CCD and external modes 92 * Data to initialize a SPCA505. Common to the CCD and external modes
93 */ 93 */
94static __u16 spca505_init_data[][3] = { 94static const __u16 spca505_init_data[][3] = {
95 /* line bmRequest,value,index */ 95 /* line bmRequest,value,index */
96 /* 1819 */ 96 /* 1819 */
97 {SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3}, 97 {SPCA50X_REG_GLOBAL, SPCA50X_GMISC3_SAA7113RST, SPCA50X_GLOBAL_MISC3},
@@ -130,7 +130,7 @@ static __u16 spca505_init_data[][3] = {
130/* 130/*
131 * Data to initialize the camera using the internal CCD 131 * Data to initialize the camera using the internal CCD
132 */ 132 */
133static __u16 spca505_open_data_ccd[][3] = { 133static const __u16 spca505_open_data_ccd[][3] = {
134 /* line bmRequest,value,index */ 134 /* line bmRequest,value,index */
135 /* Internal CCD data set */ 135 /* Internal CCD data set */
136 /* 1891 */ {0x3, 0x04, 0x01}, 136 /* 1891 */ {0x3, 0x04, 0x01},
@@ -319,7 +319,7 @@ static __u16 spca505_open_data_ccd[][3] = {
319/* 319/*
320 * Data to initialize a SPCA505. Common to the CCD and external modes 320 * Data to initialize a SPCA505. Common to the CCD and external modes
321 */ 321 */
322static __u16 spca505b_init_data[][3] = { 322static const __u16 spca505b_init_data[][3] = {
323/* start */ 323/* start */
324 {0x02, 0x00, 0x00}, /* init */ 324 {0x02, 0x00, 0x00}, /* init */
325 {0x02, 0x00, 0x01}, 325 {0x02, 0x00, 0x01},
@@ -383,7 +383,7 @@ static __u16 spca505b_init_data[][3] = {
383/* 383/*
384 * Data to initialize the camera using the internal CCD 384 * Data to initialize the camera using the internal CCD
385 */ 385 */
386static __u16 spca505b_open_data_ccd[][3] = { 386static const __u16 spca505b_open_data_ccd[][3] = {
387 387
388/* {0x02,0x00,0x00}, */ 388/* {0x02,0x00,0x00}, */
389 {0x03, 0x04, 0x01}, /* rst */ 389 {0x03, 0x04, 0x01}, /* rst */
@@ -579,7 +579,7 @@ static int reg_read(struct usb_device *dev,
579 __u16 length) /* wLength (1 or 2 only) */ 579 __u16 length) /* wLength (1 or 2 only) */
580{ 580{
581 int ret; 581 int ret;
582 unsigned char buf[4]; 582 __u8 buf[4];
583 583
584 buf[1] = 0; 584 buf[1] = 0;
585 ret = usb_control_msg(dev, 585 ret = usb_control_msg(dev,
@@ -599,7 +599,7 @@ static int reg_read(struct usb_device *dev,
599} 599}
600 600
601static int write_vector(struct gspca_dev *gspca_dev, 601static int write_vector(struct gspca_dev *gspca_dev,
602 __u16 data[][3]) 602 const __u16 data[][3])
603{ 603{
604 struct usb_device *dev = gspca_dev->dev; 604 struct usb_device *dev = gspca_dev->dev;
605 int ret, i = 0; 605 int ret, i = 0;
@@ -801,7 +801,7 @@ static void yyuv_decode(unsigned char *out,
801 801
802static void sd_pkt_scan(struct gspca_dev *gspca_dev, 802static void sd_pkt_scan(struct gspca_dev *gspca_dev,
803 struct gspca_frame *frame, /* target */ 803 struct gspca_frame *frame, /* target */
804 unsigned char *data, /* isoc packet */ 804 __u8 *data, /* isoc packet */
805 int len) /* iso packet length */ 805 int len) /* iso packet length */
806{ 806{
807 struct sd *sd = (struct sd *) gspca_dev; 807 struct sd *sd = (struct sd *) gspca_dev;
@@ -878,7 +878,7 @@ static int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val)
878} 878}
879 879
880/* sub-driver description */ 880/* sub-driver description */
881static struct sd_desc sd_desc = { 881static const struct sd_desc sd_desc = {
882 .name = MODULE_NAME, 882 .name = MODULE_NAME,
883 .ctrls = sd_ctrls, 883 .ctrls = sd_ctrls,
884 .nctrls = ARRAY_SIZE(sd_ctrls), 884 .nctrls = ARRAY_SIZE(sd_ctrls),
@@ -893,7 +893,7 @@ static struct sd_desc sd_desc = {
893 893
894/* -- module initialisation -- */ 894/* -- module initialisation -- */
895#define DVNM(name) .driver_info = (kernel_ulong_t) name 895#define DVNM(name) .driver_info = (kernel_ulong_t) name
896static __devinitdata struct usb_device_id device_table[] = { 896static const __devinitdata struct usb_device_id device_table[] = {
897 {USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")}, 897 {USB_DEVICE(0x041e, 0x401d), DVNM("Creative Webcam NX ULTRA")},
898 {USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")}, 898 {USB_DEVICE(0x0733, 0x0430), DVNM("Intel PC Camera Pro")},
899 {} 899 {}