[media] pwc: Use one shared usb command buffer
commit24be689bfbbcd6c047d7918784ff810e97648006
authorHans de Goede <hdegoede@redhat.com>
Tue, 10 Jan 2012 20:02:04 +0000 (10 17:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 16 Jan 2012 13:27:58 +0000 (16 11:27 -0200)
treeb682e75ed5ccd2124d5d44cf528707562c5a6f00
parent1c852201a28601b1379857f615e99071211294c6
[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>
drivers/media/video/pwc/pwc-ctrl.c
drivers/media/video/pwc/pwc-dec1.c
drivers/media/video/pwc/pwc-dec1.h
drivers/media/video/pwc/pwc-dec23.c
drivers/media/video/pwc/pwc-dec23.h
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc-v4l.c
drivers/media/video/pwc/pwc.h