summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-10 17:02:04 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-16 11:27:58 -0200
commit24be689bfbbcd6c047d7918784ff810e97648006 (patch)
treeb682e75ed5ccd2124d5d44cf528707562c5a6f00 /drivers/media/video/pwc/pwc.h
parent1c852201a28601b1379857f615e99071211294c6 (diff)
[media] pwc: Use one shared usb command buffer
The pwc driver used to: 1. kmalloc a buffer 2. memcpy data to send over usb there 3. do the usb_control_msg call (which does not work with data on the stack) 4. free the buffer For every usb command send. This patch changes the code to instead malloc a buffer for this purpose once and use it everywhere. [mchehab@redhat.com: Fix a compilation breakage with allyesconfig: drivers/media/video/pwc/pwc-ctrl.c: In function ‘pwc_get_cmos_sensor’: drivers/media/video/pwc/pwc-ctrl.c:546:3: warning: passing argument 4 of ‘recv_control_msg’ makes integer from pointer without a cast [en$ drivers/media/video/pwc/pwc-ctrl.c:107:12: note: expected ‘int’ but argument is of type ‘unsigned char *’ drivers/media/video/pwc/pwc-ctrl.c:546:3: error: too many arguments to function ‘recv_control_msg’ drivers/media/video/pwc/pwc-ctrl.c:107:12: note: declared here] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pwc/pwc.h')
-rw-r--r--drivers/media/video/pwc/pwc.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h
index f441999e5bd..e4d4d711dd1 100644
--- a/drivers/media/video/pwc/pwc.h
+++ b/drivers/media/video/pwc/pwc.h
@@ -134,9 +134,6 @@
#define DEVICE_USE_CODEC3(x) ((x)>=700)
#define DEVICE_USE_CODEC23(x) ((x)>=675)
-/* from pwc-dec.h */
-#define PWCX_FLAG_PLANAR 0x0001
-
/* Request types: video */
#define SET_LUM_CTL 0x01
#define GET_LUM_CTL 0x02
@@ -250,8 +247,8 @@ struct pwc_device
char vmirror; /* for ToUCaM series */
char power_save; /* Do powersaving for this cam */
- int cmd_len;
unsigned char cmd_buf[13];
+ unsigned char *ctrl_buf;
struct urb *urbs[MAX_ISO_BUFS];
char iso_init;