diff options
Diffstat (limited to 'drivers/media/video/gspca/conex.c')
-rw-r--r-- | drivers/media/video/gspca/conex.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c index cd3a3f5829b2..4d9f4cc255a9 100644 --- a/drivers/media/video/gspca/conex.c +++ b/drivers/media/video/gspca/conex.c | |||
@@ -124,7 +124,7 @@ static void reg_r(struct gspca_dev *gspca_dev, | |||
124 | struct usb_device *dev = gspca_dev->dev; | 124 | struct usb_device *dev = gspca_dev->dev; |
125 | 125 | ||
126 | #ifdef GSPCA_DEBUG | 126 | #ifdef GSPCA_DEBUG |
127 | if (len > sizeof gspca_dev->usb_buf) { | 127 | if (len > USB_BUF_SZ) { |
128 | err("reg_r: buffer overflow"); | 128 | err("reg_r: buffer overflow"); |
129 | return; | 129 | return; |
130 | } | 130 | } |
@@ -164,7 +164,7 @@ static void reg_w(struct gspca_dev *gspca_dev, | |||
164 | struct usb_device *dev = gspca_dev->dev; | 164 | struct usb_device *dev = gspca_dev->dev; |
165 | 165 | ||
166 | #ifdef GSPCA_DEBUG | 166 | #ifdef GSPCA_DEBUG |
167 | if (len > sizeof gspca_dev->usb_buf) { | 167 | if (len > USB_BUF_SZ) { |
168 | err("reg_w: buffer overflow"); | 168 | err("reg_w: buffer overflow"); |
169 | return; | 169 | return; |
170 | } | 170 | } |
@@ -731,13 +731,13 @@ static void cx11646_jpeg(struct gspca_dev*gspca_dev) | |||
731 | reg_w_val(gspca_dev, 0x0000, 0x00); | 731 | reg_w_val(gspca_dev, 0x0000, 0x00); |
732 | /* wait for completion */ | 732 | /* wait for completion */ |
733 | retry = 50; | 733 | retry = 50; |
734 | while (retry--) { | 734 | do { |
735 | reg_r(gspca_dev, 0x0002, 1); | 735 | reg_r(gspca_dev, 0x0002, 1); |
736 | /* 0x07 until 0x00 */ | 736 | /* 0x07 until 0x00 */ |
737 | if (gspca_dev->usb_buf[0] == 0x00) | 737 | if (gspca_dev->usb_buf[0] == 0x00) |
738 | break; | 738 | break; |
739 | reg_w_val(gspca_dev, 0x0053, 0x00); | 739 | reg_w_val(gspca_dev, 0x0053, 0x00); |
740 | } | 740 | } while (--retry); |
741 | if (retry == 0) | 741 | if (retry == 0) |
742 | PDEBUG(D_ERR, "Damned Errors sending jpeg Table"); | 742 | PDEBUG(D_ERR, "Damned Errors sending jpeg Table"); |
743 | /* send the qtable now */ | 743 | /* send the qtable now */ |
@@ -826,8 +826,8 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
826 | return 0; | 826 | return 0; |
827 | } | 827 | } |
828 | 828 | ||
829 | /* this function is called at open time */ | 829 | /* this function is called at probe and resume time */ |
830 | static int sd_open(struct gspca_dev *gspca_dev) | 830 | static int sd_init(struct gspca_dev *gspca_dev) |
831 | { | 831 | { |
832 | cx11646_init1(gspca_dev); | 832 | cx11646_init1(gspca_dev); |
833 | cx11646_initsize(gspca_dev); | 833 | cx11646_initsize(gspca_dev); |
@@ -845,10 +845,6 @@ static void sd_start(struct gspca_dev *gspca_dev) | |||
845 | cx11646_jpeg(gspca_dev); | 845 | cx11646_jpeg(gspca_dev); |
846 | } | 846 | } |
847 | 847 | ||
848 | static void sd_stopN(struct gspca_dev *gspca_dev) | ||
849 | { | ||
850 | } | ||
851 | |||
852 | static void sd_stop0(struct gspca_dev *gspca_dev) | 848 | static void sd_stop0(struct gspca_dev *gspca_dev) |
853 | { | 849 | { |
854 | int retry = 50; | 850 | int retry = 50; |
@@ -871,10 +867,6 @@ static void sd_stop0(struct gspca_dev *gspca_dev) | |||
871 | reg_w_val(gspca_dev, 0x00fc, 0xe0); | 867 | reg_w_val(gspca_dev, 0x00fc, 0xe0); |
872 | } | 868 | } |
873 | 869 | ||
874 | static void sd_close(struct gspca_dev *gspca_dev) | ||
875 | { | ||
876 | } | ||
877 | |||
878 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 870 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
879 | struct gspca_frame *frame, /* target */ | 871 | struct gspca_frame *frame, /* target */ |
880 | __u8 *data, /* isoc packet */ | 872 | __u8 *data, /* isoc packet */ |
@@ -998,11 +990,9 @@ static struct sd_desc sd_desc = { | |||
998 | .ctrls = sd_ctrls, | 990 | .ctrls = sd_ctrls, |
999 | .nctrls = ARRAY_SIZE(sd_ctrls), | 991 | .nctrls = ARRAY_SIZE(sd_ctrls), |
1000 | .config = sd_config, | 992 | .config = sd_config, |
1001 | .open = sd_open, | 993 | .init = sd_init, |
1002 | .start = sd_start, | 994 | .start = sd_start, |
1003 | .stopN = sd_stopN, | ||
1004 | .stop0 = sd_stop0, | 995 | .stop0 = sd_stop0, |
1005 | .close = sd_close, | ||
1006 | .pkt_scan = sd_pkt_scan, | 996 | .pkt_scan = sd_pkt_scan, |
1007 | }; | 997 | }; |
1008 | 998 | ||
@@ -1026,6 +1016,10 @@ static struct usb_driver sd_driver = { | |||
1026 | .id_table = device_table, | 1016 | .id_table = device_table, |
1027 | .probe = sd_probe, | 1017 | .probe = sd_probe, |
1028 | .disconnect = gspca_disconnect, | 1018 | .disconnect = gspca_disconnect, |
1019 | #ifdef CONFIG_PM | ||
1020 | .suspend = gspca_suspend, | ||
1021 | .resume = gspca_resume, | ||
1022 | #endif | ||
1029 | }; | 1023 | }; |
1030 | 1024 | ||
1031 | /* -- module insert / remove -- */ | 1025 | /* -- module insert / remove -- */ |