diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c
index b548101..013d593 100644
--- a/drivers/media/video/gspca/conex.c
+++ b/drivers/media/video/gspca/conex.c
@@ -25,8 +25,8 @@
 #define CONEX_CAM 1		/* special JPEG header */
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA USB Conexant Camera Driver");
@@ -119,40 +119,67 @@
 		.priv = 0},
 };
 
-static void reg_r(struct usb_device *dev,
-			   __u16 index,
-			   __u8 *buffer, __u16 length)
+/* the read bytes are found in gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  __u16 len)
 {
+	struct usb_device *dev = gspca_dev->dev;
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+	if (len > sizeof gspca_dev->usb_buf) {
+		err("reg_r: buffer overflow");
+		return;
+	}
+#endif
 	usb_control_msg(dev,
 			usb_rcvctrlpipe(dev, 0),
 			0,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,
-			index, buffer, length,
+			index, gspca_dev->usb_buf, len,
 			500);
-	PDEBUG(D_USBI, "reg read [%02x] -> %02x ..", index, *buffer);
+	PDEBUG(D_USBI, "reg read [%02x] -> %02x ..",
+			index, gspca_dev->usb_buf[0]);
 }
 
-static void reg_w(struct usb_device *dev,
-		  __u16 index,
-		  const __u8 *buffer, __u16 len)
+/* the bytes to write are in gspca_dev->usb_buf */
+static void reg_w_val(struct gspca_dev *gspca_dev,
+			__u16 index,
+			__u8 val)
 {
-	__u8 tmpbuf[8];
+	struct usb_device *dev = gspca_dev->dev;
 
-#ifdef CONFIG_VIDEO_ADV_DEBUG
-	if (len > sizeof tmpbuf) {
-		PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow");
-		return;
-	}
-	PDEBUG(D_USBO, "reg write [%02x] = %02x..", index, *buffer);
-#endif
-	memcpy(tmpbuf, buffer, len);
+	gspca_dev->usb_buf[0] = val;
 	usb_control_msg(dev,
 			usb_sndctrlpipe(dev, 0),
 			0,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,
-			index, tmpbuf, len, 500);
+			index, gspca_dev->usb_buf, 1, 500);
+}
+
+static void reg_w(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  const __u8 *buffer,
+		  __u16 len)
+{
+	struct usb_device *dev = gspca_dev->dev;
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+	if (len > sizeof gspca_dev->usb_buf) {
+		err("reg_w: buffer overflow");
+		return;
+	}
+	PDEBUG(D_USBO, "reg write [%02x] = %02x..", index, *buffer);
+#endif
+	memcpy(gspca_dev->usb_buf, buffer, len);
+	usb_control_msg(dev,
+			usb_sndctrlpipe(dev, 0),
+			0,
+			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+			0,
+			index, gspca_dev->usb_buf, len, 500);
 }
 
 static const __u8 cx_sensor_init[][4] = {
@@ -232,17 +259,14 @@
 };
 static void cx11646_fw(struct gspca_dev*gspca_dev)
 {
-	__u8 val;
 	int i = 0;
 
-	val = 0x02;
-	reg_w(gspca_dev->dev, 0x006a, &val, 1);
+	reg_w_val(gspca_dev, 0x006a, 0x02);
 	while (cx11646_fw1[i][1]) {
-		reg_w(gspca_dev->dev, 0x006b, cx11646_fw1[i], 3);
+		reg_w(gspca_dev, 0x006b, cx11646_fw1[i], 3);
 		i++;
 	}
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x006a, &val, 1);
+	reg_w_val(gspca_dev, 0x006a, 0x00);
 }
 
 static const __u8 cxsensor[] = {
@@ -273,52 +297,47 @@
 
 static void cx_sensor(struct gspca_dev*gspca_dev)
 {
-	__u8 val;
 	int i = 0;
-	__u8 bufread[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 	int length;
 	const __u8 *ptsensor = cxsensor;
 
-	reg_w(gspca_dev->dev, 0x0020, reg20, 8);
-	reg_w(gspca_dev->dev, 0x0028, reg28, 8);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 8);
-	val = 0x03;
-	reg_w(gspca_dev->dev, 0x0092, &val, 1);
+	reg_w(gspca_dev, 0x0020, reg20, 8);
+	reg_w(gspca_dev, 0x0028, reg28, 8);
+	reg_w(gspca_dev, 0x0010, reg10, 8);
+	reg_w_val(gspca_dev, 0x0092, 0x03);
 
 	switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
 	case 0:
-		reg_w(gspca_dev->dev, 0x0071, reg71a, 4);
+		reg_w(gspca_dev, 0x0071, reg71a, 4);
 		break;
 	case 1:
-		reg_w(gspca_dev->dev, 0x0071, reg71b, 4);
+		reg_w(gspca_dev, 0x0071, reg71b, 4);
 		break;
 	default:
 /*	case 2: */
-		reg_w(gspca_dev->dev, 0x0071, reg71c, 4);
+		reg_w(gspca_dev, 0x0071, reg71c, 4);
 		break;
 	case 3:
-		reg_w(gspca_dev->dev, 0x0071, reg71d, 4);
+		reg_w(gspca_dev, 0x0071, reg71d, 4);
 		break;
 	}
-	reg_w(gspca_dev->dev, 0x007b, reg7b, 6);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00f8, &val, 1);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 8);
-	val = 0x41;
-	reg_w(gspca_dev->dev, 0x0098, &val, 1);
+	reg_w(gspca_dev, 0x007b, reg7b, 6);
+	reg_w_val(gspca_dev, 0x00f8, 0x00);
+	reg_w(gspca_dev, 0x0010, reg10, 8);
+	reg_w_val(gspca_dev, 0x0098, 0x41);
 	for (i = 0; i < 11; i++) {
 		if (i == 3 || i == 5 || i == 8)
 			length = 8;
 		else
 			length = 4;
-		reg_w(gspca_dev->dev, 0x00e5, ptsensor, length);
+		reg_w(gspca_dev, 0x00e5, ptsensor, length);
 		if (length == 4)
-			reg_r(gspca_dev->dev, 0x00e8, &val, 1);
+			reg_r(gspca_dev, 0x00e8, 1);
 		else
-			reg_r(gspca_dev->dev, 0x00e8, bufread, length);
+			reg_r(gspca_dev, 0x00e8, length);
 		ptsensor += length;
 	}
-	reg_r(gspca_dev->dev, 0x00e7, bufread, 8);
+	reg_r(gspca_dev, 0x00e7, 8);
 }
 
 static const __u8 cx_inits_176[] = {
@@ -358,10 +377,9 @@
 	0x77, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
-static int cx11646_initsize(struct gspca_dev *gspca_dev)
+static void cx11646_initsize(struct gspca_dev *gspca_dev)
 {
 	const __u8 *cxinit;
-	__u8 val;
 	static const __u8 reg12[] = { 0x08, 0x05, 0x07, 0x04, 0x24 };
 	static const __u8 reg17[] =
 			{ 0x0a, 0x00, 0xf2, 0x01, 0x0f, 0x00, 0x97, 0x02 };
@@ -381,35 +399,29 @@
 		cxinit = cx_inits_176;
 		break;
 	}
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x009a, &val, 1);
-	val = 0x10;
-	reg_w(gspca_dev->dev, 0x0010, &val, 1);
-	reg_w(gspca_dev->dev, 0x0012, reg12, 5);
-	reg_w(gspca_dev->dev, 0x0017, reg17, 8);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c0, &val, 1);
-	val = 0x04;
-	reg_w(gspca_dev->dev, 0x00c1, &val, 1);
-	val = 0x04;
-	reg_w(gspca_dev->dev, 0x00c2, &val, 1);
+	reg_w_val(gspca_dev, 0x009a, 0x01);
+	reg_w_val(gspca_dev, 0x0010, 0x10);
+	reg_w(gspca_dev, 0x0012, reg12, 5);
+	reg_w(gspca_dev, 0x0017, reg17, 8);
+	reg_w_val(gspca_dev, 0x00c0, 0x00);
+	reg_w_val(gspca_dev, 0x00c1, 0x04);
+	reg_w_val(gspca_dev, 0x00c2, 0x04);
 
-	reg_w(gspca_dev->dev, 0x0061, cxinit, 8);
+	reg_w(gspca_dev, 0x0061, cxinit, 8);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x00ca, cxinit, 8);
+	reg_w(gspca_dev, 0x00ca, cxinit, 8);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x00d2, cxinit, 8);
+	reg_w(gspca_dev, 0x00d2, cxinit, 8);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x00da, cxinit, 6);
+	reg_w(gspca_dev, 0x00da, cxinit, 6);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x0041, cxinit, 8);
+	reg_w(gspca_dev, 0x0041, cxinit, 8);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x0049, cxinit, 8);
+	reg_w(gspca_dev, 0x0049, cxinit, 8);
 	cxinit += 8;
-	reg_w(gspca_dev->dev, 0x0051, cxinit, 2);
+	reg_w(gspca_dev, 0x0051, cxinit, 2);
 
-	reg_r(gspca_dev->dev, 0x0010, &val, 1);
-	return val;
+	reg_r(gspca_dev, 0x0010, 1);
 }
 
 static const __u8 cx_jpeg_init[][8] = {
@@ -636,26 +648,21 @@
 
 static void cx11646_jpegInit(struct gspca_dev*gspca_dev)
 {
-	__u8 val;
 	int i;
 	int length;
 
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x00c0, &val, 1);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c3, &val, 1);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c0, &val, 1);
-	reg_r(gspca_dev->dev, 0x0001, &val, 1);
+	reg_w_val(gspca_dev, 0x00c0, 0x01);
+	reg_w_val(gspca_dev, 0x00c3, 0x00);
+	reg_w_val(gspca_dev, 0x00c0, 0x00);
+	reg_r(gspca_dev, 0x0001, 1);
 	length = 8;
 	for (i = 0; i < 79; i++) {
 		if (i == 78)
 			length = 6;
-		reg_w(gspca_dev->dev, 0x0008, cx_jpeg_init[i], length);
+		reg_w(gspca_dev, 0x0008, cx_jpeg_init[i], length);
 	}
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);
-	val = 0x14;
-	reg_w(gspca_dev->dev, 0x0055, &val, 1);
+	reg_r(gspca_dev, 0x0002, 1);
+	reg_w_val(gspca_dev, 0x0055, 0x14);
 }
 
 static const __u8 reg12[] = { 0x0a, 0x05, 0x07, 0x04, 0x19 };
@@ -665,31 +672,26 @@
 static const __u8 regE5b[] = { 0x88, 0x0b, 0x12, 0x01 };
 static const __u8 regE5c[] = { 0x88, 0x05, 0x01, 0x01 };
 static const __u8 reg51[] = { 0x77, 0x03 };
-static const __u8 reg70 = 0x03;
+#define reg70 0x03
 
 static void cx11646_jpeg(struct gspca_dev*gspca_dev)
 {
-	__u8 val;
 	int i;
 	int length;
 	__u8 Reg55;
-	__u8 bufread[8];
 	int retry;
 
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x00c0, &val, 1);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c3, &val, 1);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c0, &val, 1);
-	reg_r(gspca_dev->dev, 0x0001, &val, 1);
+	reg_w_val(gspca_dev, 0x00c0, 0x01);
+	reg_w_val(gspca_dev, 0x00c3, 0x00);
+	reg_w_val(gspca_dev, 0x00c0, 0x00);
+	reg_r(gspca_dev, 0x0001, 1);
 	length = 8;
 	switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
 	case 0:
 		for (i = 0; i < 27; i++) {
 			if (i == 26)
 				length = 2;
-			reg_w(gspca_dev->dev, 0x0008, cxjpeg_640[i], length);
+			reg_w(gspca_dev, 0x0008, cxjpeg_640[i], length);
 		}
 		Reg55 = 0x28;
 		break;
@@ -697,7 +699,7 @@
 		for (i = 0; i < 27; i++) {
 			if (i == 26)
 				length = 2;
-			reg_w(gspca_dev->dev, 0x0008, cxjpeg_352[i], length);
+			reg_w(gspca_dev, 0x0008, cxjpeg_352[i], length);
 		}
 		Reg55 = 0x16;
 		break;
@@ -706,7 +708,7 @@
 		for (i = 0; i < 27; i++) {
 			if (i == 26)
 				length = 2;
-			reg_w(gspca_dev->dev, 0x0008, cxjpeg_320[i], length);
+			reg_w(gspca_dev, 0x0008, cxjpeg_320[i], length);
 		}
 		Reg55 = 0x14;
 		break;
@@ -714,124 +716,98 @@
 		for (i = 0; i < 27; i++) {
 			if (i == 26)
 				length = 2;
-			reg_w(gspca_dev->dev, 0x0008, cxjpeg_176[i], length);
+			reg_w(gspca_dev, 0x0008, cxjpeg_176[i], length);
 		}
 		Reg55 = 0x0B;
 		break;
 	}
 
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);
-	val = Reg55;
-	reg_w(gspca_dev->dev, 0x0055, &val, 1);
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 2);
-	val = 0x02;
-	reg_w(gspca_dev->dev, 0x0054, &val, 1);
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x0054, &val, 1);
-	val = 0x94;
-	reg_w(gspca_dev->dev, 0x0000, &val, 1);
-	val = 0xc0;
-	reg_w(gspca_dev->dev, 0x0053, &val, 1);
-	val = 0xe1;
-	reg_w(gspca_dev->dev, 0x00fc, &val, 1);
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x0000, &val, 1);
+	reg_r(gspca_dev, 0x0002, 1);
+	reg_w_val(gspca_dev, 0x0055, Reg55);
+	reg_r(gspca_dev, 0x0002, 1);
+	reg_w(gspca_dev, 0x0010, reg10, 2);
+	reg_w_val(gspca_dev, 0x0054, 0x02);
+	reg_w_val(gspca_dev, 0x0054, 0x01);
+	reg_w_val(gspca_dev, 0x0000, 0x94);
+	reg_w_val(gspca_dev, 0x0053, 0xc0);
+	reg_w_val(gspca_dev, 0x00fc, 0xe1);
+	reg_w_val(gspca_dev, 0x0000, 0x00);
 	/* wait for completion */
 	retry = 50;
 	while (retry--) {
-		reg_r(gspca_dev->dev, 0x0002, &val, 1);
+		reg_r(gspca_dev, 0x0002, 1);
 							/* 0x07 until 0x00 */
-		if (val == 0x00)
+		if (gspca_dev->usb_buf[0] == 0x00)
 			break;
-		val = 0x00;
-		reg_w(gspca_dev->dev, 0x0053, &val, 1);
+		reg_w_val(gspca_dev, 0x0053, 0x00);
 	}
 	if (retry == 0)
 		PDEBUG(D_ERR, "Damned Errors sending jpeg Table");
 	/* send the qtable now */
-	reg_r(gspca_dev->dev, 0x0001, &val, 1);		/* -> 0x18 */
+	reg_r(gspca_dev, 0x0001, 1);		/* -> 0x18 */
 	length = 8;
 	for (i = 0; i < 18; i++) {
 		if (i == 17)
 			length = 2;
-		reg_w(gspca_dev->dev, 0x0008, cxjpeg_qtable[i], length);
+		reg_w(gspca_dev, 0x0008, cxjpeg_qtable[i], length);
 
 	}
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);	/* 0x00 */
-	reg_r(gspca_dev->dev, 0x0053, &val, 1);	/* 0x00 */
-	val = 0x02;
-	reg_w(gspca_dev->dev, 0x0054, &val, 1);
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x0054, &val, 1);
-	val = 0x94;
-	reg_w(gspca_dev->dev, 0x0000, &val, 1);
-	val = 0xc0;
-	reg_w(gspca_dev->dev, 0x0053, &val, 1);
+	reg_r(gspca_dev, 0x0002, 1);	/* 0x00 */
+	reg_r(gspca_dev, 0x0053, 1);	/* 0x00 */
+	reg_w_val(gspca_dev, 0x0054, 0x02);
+	reg_w_val(gspca_dev, 0x0054, 0x01);
+	reg_w_val(gspca_dev, 0x0000, 0x94);
+	reg_w_val(gspca_dev, 0x0053, 0xc0);
 
-	reg_r(gspca_dev->dev, 0x0038, &val, 1);	/* 0x40 */
-	reg_r(gspca_dev->dev, 0x0038, &val, 1);	/* 0x40 */
-	reg_r(gspca_dev->dev, 0x001f, &val, 1);	/* 0x38 */
-	reg_w(gspca_dev->dev, 0x0012, reg12, 5);
-	reg_w(gspca_dev->dev, 0x00e5, regE5_8, 8);
-	reg_r(gspca_dev->dev, 0x00e8, bufread, 8);
-	reg_w(gspca_dev->dev, 0x00e5, regE5a, 4);
-	reg_r(gspca_dev->dev, 0x00e8, &val, 1);	/* 0x00 */
-	val = 0x01;
-	reg_w(gspca_dev->dev, 0x009a, &val, 1);
-	reg_w(gspca_dev->dev, 0x00e5, regE5b, 4);
-	reg_r(gspca_dev->dev, 0x00e8, &val, 1);	/* 0x00 */
-	reg_w(gspca_dev->dev, 0x00e5, regE5c, 4);
-	reg_r(gspca_dev->dev, 0x00e8, &val, 1);	/* 0x00 */
+	reg_r(gspca_dev, 0x0038, 1);		/* 0x40 */
+	reg_r(gspca_dev, 0x0038, 1);		/* 0x40 */
+	reg_r(gspca_dev, 0x001f, 1);		/* 0x38 */
+	reg_w(gspca_dev, 0x0012, reg12, 5);
+	reg_w(gspca_dev, 0x00e5, regE5_8, 8);
+	reg_r(gspca_dev, 0x00e8, 8);
+	reg_w(gspca_dev, 0x00e5, regE5a, 4);
+	reg_r(gspca_dev, 0x00e8, 1);		/* 0x00 */
+	reg_w_val(gspca_dev, 0x009a, 0x01);
+	reg_w(gspca_dev, 0x00e5, regE5b, 4);
+	reg_r(gspca_dev, 0x00e8, 1);		/* 0x00 */
+	reg_w(gspca_dev, 0x00e5, regE5c, 4);
+	reg_r(gspca_dev, 0x00e8, 1);		/* 0x00 */
 
-	reg_w(gspca_dev->dev, 0x0051, reg51, 2);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 2);
-	reg_w(gspca_dev->dev, 0x0070, &reg70, 1);
+	reg_w(gspca_dev, 0x0051, reg51, 2);
+	reg_w(gspca_dev, 0x0010, reg10, 2);
+	reg_w_val(gspca_dev, 0x0070, reg70);
 }
 
 static void cx11646_init1(struct gspca_dev *gspca_dev)
 {
-	__u8 val;
 	int i = 0;
 
-	val = 0;
-	reg_w(gspca_dev->dev, 0x0010, &val, 1);
-	reg_w(gspca_dev->dev, 0x0053, &val, 1);
-	reg_w(gspca_dev->dev, 0x0052, &val, 1);
-	val = 0x2f;
-	reg_w(gspca_dev->dev, 0x009b, &val, 1);
-	val = 0x10;
-	reg_w(gspca_dev->dev, 0x009c, &val, 1);
-	reg_r(gspca_dev->dev, 0x0098, &val, 1);
-	val = 0x40;
-	reg_w(gspca_dev->dev, 0x0098, &val, 1);
-	reg_r(gspca_dev->dev, 0x0099, &val, 1);
-	val = 0x07;
-	reg_w(gspca_dev->dev, 0x0099, &val, 1);
-	val = 0x40;
-	reg_w(gspca_dev->dev, 0x0039, &val, 1);
-	val = 0xff;
-	reg_w(gspca_dev->dev, 0x003c, &val, 1);
-	val = 0x1f;
-	reg_w(gspca_dev->dev, 0x003f, &val, 1);
-	val = 0x40;
-	reg_w(gspca_dev->dev, 0x003d, &val, 1);
-/*	val= 0x60; */
-/*	reg_w(gspca_dev->dev, 0x00, 0x00, 0x003d, &val, 1); */
-	reg_r(gspca_dev->dev, 0x0099, &val, 1);			/* ->0x07 */
+	reg_w_val(gspca_dev, 0x0010, 0x00);
+	reg_w_val(gspca_dev, 0x0053, 0x00);
+	reg_w_val(gspca_dev, 0x0052, 0x00);
+	reg_w_val(gspca_dev, 0x009b, 0x2f);
+	reg_w_val(gspca_dev, 0x009c, 0x10);
+	reg_r(gspca_dev, 0x0098, 1);
+	reg_w_val(gspca_dev, 0x0098, 0x40);
+	reg_r(gspca_dev, 0x0099, 1);
+	reg_w_val(gspca_dev, 0x0099, 0x07);
+	reg_w_val(gspca_dev, 0x0039, 0x40);
+	reg_w_val(gspca_dev, 0x003c, 0xff);
+	reg_w_val(gspca_dev, 0x003f, 0x1f);
+	reg_w_val(gspca_dev, 0x003d, 0x40);
+/*	reg_w_val(gspca_dev, 0x003d, 0x60); */
+	reg_r(gspca_dev, 0x0099, 1);			/* ->0x07 */
 
 	while (cx_sensor_init[i][0]) {
-		reg_w(gspca_dev->dev, 0x00e5, cx_sensor_init[i], 1);
-		reg_r(gspca_dev->dev, 0x00e8, &val, 1);		/* -> 0x00 */
+		reg_w_val(gspca_dev, 0x00e5, cx_sensor_init[i][0]);
+		reg_r(gspca_dev, 0x00e8, 1);		/* -> 0x00 */
 		if (i == 1) {
-			val = 1;
-			reg_w(gspca_dev->dev, 0x00ed, &val, 1);
-			reg_r(gspca_dev->dev, 0x00ed, &val, 1);	/* -> 0x01 */
+			reg_w_val(gspca_dev, 0x00ed, 0x01);
+			reg_r(gspca_dev, 0x00ed, 1);	/* -> 0x01 */
 		}
 		i++;
 	}
-	val = 0x00;
-	reg_w(gspca_dev->dev, 0x00c3, &val, 1);
+	reg_w_val(gspca_dev, 0x00c3, 0x00);
 }
 
 /* this function is called at probe time */
@@ -880,29 +856,23 @@
 static void sd_stop0(struct gspca_dev *gspca_dev)
 {
 	int retry = 50;
-	__u8 val;
 
-	val = 0;
-	reg_w(gspca_dev->dev, 0x0000, &val, 1);
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);
-	val = 0;
-	reg_w(gspca_dev->dev, 0x0053, &val, 1);
+	reg_w_val(gspca_dev, 0x0000, 0x00);
+	reg_r(gspca_dev, 0x0002, 1);
+	reg_w_val(gspca_dev, 0x0053, 0x00);
 
 	while (retry--) {
-/*		reg_r(gspca_dev->dev, 0x0002, &val, 1);*/
-		reg_r(gspca_dev->dev, 0x0053, &val, 1);
-		if (val == 0)
+/*		reg_r(gspca_dev, 0x0002, 1);*/
+		reg_r(gspca_dev, 0x0053, 1);
+		if (gspca_dev->usb_buf[0] == 0)
 			break;
 	}
-	val = 0;
-	reg_w(gspca_dev->dev, 0x0000, &val, 1);
-	reg_r(gspca_dev->dev, 0x0002, &val, 1);
+	reg_w_val(gspca_dev, 0x0000, 0x00);
+	reg_r(gspca_dev, 0x0002, 1);
 
-	val = 0;
-	reg_w(gspca_dev->dev, 0x0010, &val, 1);
-	reg_r(gspca_dev->dev, 0x0033, &val, 1);
-	val = 0xe0;
-	reg_w(gspca_dev->dev, 0x00fc, &val, 1);
+	reg_w_val(gspca_dev, 0x0010, 0x00);
+	reg_r(gspca_dev, 0x0033, 1);
+	reg_w_val(gspca_dev, 0x00fc, 0xe0);
 }
 
 static void sd_close(struct gspca_dev *gspca_dev)
@@ -937,22 +907,20 @@
 	__u8 reg51c[2];
 	__u8 bright;
 	__u8 colors;
-	__u8 val;
-	__u8 bufread[8];
 
 	bright = sd->brightness;
 	regE5cbx[2] = bright;
-	reg_w(gspca_dev->dev, 0x00e5, regE5cbx, 8);
-	reg_r(gspca_dev->dev, 0x00e8, bufread, 8);
-	reg_w(gspca_dev->dev, 0x00e5, regE5c, 4);
-	reg_r(gspca_dev->dev, 0x00e8, &val, 1);	/* 0x00 */
+	reg_w(gspca_dev, 0x00e5, regE5cbx, 8);
+	reg_r(gspca_dev, 0x00e8, 8);
+	reg_w(gspca_dev, 0x00e5, regE5c, 4);
+	reg_r(gspca_dev, 0x00e8, 1);		/* 0x00 */
 
 	colors = sd->colors;
 	reg51c[0] = 0x77;
 	reg51c[1] = colors;
-	reg_w(gspca_dev->dev, 0x0051, reg51c, 2);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 2);
-	reg_w(gspca_dev->dev, 0x0070, &reg70, 1);
+	reg_w(gspca_dev, 0x0051, reg51c, 2);
+	reg_w(gspca_dev, 0x0010, reg10, 2);
+	reg_w_val(gspca_dev, 0x0070, reg70);
 }
 
 static void setcontrast(struct gspca_dev*gspca_dev)
@@ -961,16 +929,15 @@
 	__u8 regE5acx[] = { 0x88, 0x0a, 0x0c, 0x01 };	/* seem MSB */
 /*	__u8 regE5bcx[] = { 0x88, 0x0b, 0x12, 0x01};	 * LSB */
 	__u8 reg51c[2];
-	__u8 val;
 
 	regE5acx[2] = sd->contrast;
-	reg_w(gspca_dev->dev, 0x00e5, regE5acx, 4);
-	reg_r(gspca_dev->dev, 0x00e8, &val, 1);	/* 0x00 */
+	reg_w(gspca_dev, 0x00e5, regE5acx, 4);
+	reg_r(gspca_dev, 0x00e8, 1);		/* 0x00 */
 	reg51c[0] = 0x77;
 	reg51c[1] = sd->colors;
-	reg_w(gspca_dev->dev, 0x0051, reg51c, 2);
-	reg_w(gspca_dev->dev, 0x0010, reg10, 2);
-	reg_w(gspca_dev->dev, 0x0070, &reg70, 1);
+	reg_w(gspca_dev, 0x0051, reg51c, 2);
+	reg_w(gspca_dev, 0x0010, reg10, 2);
+	reg_w_val(gspca_dev, 0x0070, reg70);
 }
 
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c
index 1da6a18..5bb8dc1 100644
--- a/drivers/media/video/gspca/etoms.c
+++ b/drivers/media/video/gspca/etoms.c
@@ -22,8 +22,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("Etoms USB Camera Driver");
@@ -229,201 +229,215 @@
 
 static const __u8 I2c4[] = { 0x41, 0x08 };
 
-static void reg_r(struct usb_device *dev,
-		       __u16 index, __u8 *buffer, int len)
+/* read 'len' bytes to gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  __u16 len)
 {
+	struct usb_device *dev = gspca_dev->dev;
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+	if (len > sizeof gspca_dev->usb_buf) {
+		err("reg_r: buffer overflow");
+		return;
+	}
+#endif
 	usb_control_msg(dev,
 			usb_rcvctrlpipe(dev, 0),
 			0,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			0, index, buffer, len, 500);
+			0,
+			index, gspca_dev->usb_buf, len, 500);
+	PDEBUG(D_USBI, "reg read [%02x] -> %02x ..",
+			index, gspca_dev->usb_buf[0]);
 }
 
-static void reg_w_val(struct usb_device *dev,
-			__u16 index, __u8 val)
+static void reg_w_val(struct gspca_dev *gspca_dev,
+			__u16 index,
+			__u8 val)
 {
-	__u8 data;
+	struct usb_device *dev = gspca_dev->dev;
 
-	data = val;
+	gspca_dev->usb_buf[0] = val;
 	usb_control_msg(dev,
 			usb_sndctrlpipe(dev, 0),
 			0,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			0, index, &data, 1, 500);
+			0,
+			index, gspca_dev->usb_buf, 1, 500);
 }
 
-static void reg_w(struct usb_device *dev,
-		  __u16 index, const __u8 *buffer, __u16 len)
+static void reg_w(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  const __u8 *buffer,
+		  __u16 len)
 {
-	__u8 tmpbuf[8];
+	struct usb_device *dev = gspca_dev->dev;
 
-	memcpy(tmpbuf, buffer, len);
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+	if (len > sizeof gspca_dev->usb_buf) {
+		err("reg_w: buffer overflow");
+		return;
+	}
+	PDEBUG(D_USBO, "reg write [%02x] = %02x..", index, *buffer);
+#endif
+	memcpy(gspca_dev->usb_buf, buffer, len);
 	usb_control_msg(dev,
 			usb_sndctrlpipe(dev, 0),
 			0,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			0, index, tmpbuf, len, 500);
+			0, index, gspca_dev->usb_buf, len, 500);
 }
 
-static int Et_i2cwrite(struct usb_device *dev, __u8 reg,
-			const __u8 *buffer,
-			__u16 len, __u8 mode)
+static int i2c_w(struct gspca_dev *gspca_dev,
+		 __u8 reg,
+		 const __u8 *buffer,
+		 __u16 len, __u8 mode)
 {
 	/* buffer should be [D0..D7] */
 	__u8 ptchcount;
 
 	/* set the base address */
-	reg_w_val(dev, ET_I2C_BASE, 0x40); /* sensor base for the pas106 */
+	reg_w_val(gspca_dev, ET_I2C_BASE, 0x40);
+					 /* sensor base for the pas106 */
 	/* set count and prefetch */
 	ptchcount = ((len & 0x07) << 4) | (mode & 0x03);
-	reg_w_val(dev, ET_I2C_COUNT, ptchcount);
+	reg_w_val(gspca_dev, ET_I2C_COUNT, ptchcount);
 	/* set the register base */
-	reg_w_val(dev, ET_I2C_REG, reg);
+	reg_w_val(gspca_dev, ET_I2C_REG, reg);
 	while (--len >= 0)
-		reg_w_val(dev, ET_I2C_DATA0 + len, buffer[len]);
+		reg_w_val(gspca_dev, ET_I2C_DATA0 + len, buffer[len]);
 	return 0;
 }
 
-static int Et_i2cread(struct usb_device *dev, __u8 reg,
-			__u8 *buffer,
-			__u16 length, __u8 mode)
+static int i2c_r(struct gspca_dev *gspca_dev,
+			__u8 reg)
 {
-	/* buffer should be [D0..D7] */
-	int i, j;
-	__u8 ptchcount;
-
 	/* set the base address */
-	reg_w_val(dev, ET_I2C_BASE, 0x40); /* sensor base for the pas106 */
-	/* set count and prefetch */
-	ptchcount = ((length & 0x07) << 4) | (mode & 0x03);
-	reg_w_val(dev, ET_I2C_COUNT, ptchcount);
-	/* set the register base */
-	reg_w_val(dev, ET_I2C_REG, reg);
-	reg_w_val(dev, ET_I2C_PREFETCH, 0x02);	/* prefetch */
-	reg_w_val(dev, ET_I2C_PREFETCH, 0);
-	j = length - 1;
-	for (i = 0; i < length; i++) {
-		reg_r(dev, (ET_I2C_DATA0 + j), &buffer[j], 1);
-		j--;
-	}
+	reg_w_val(gspca_dev, ET_I2C_BASE, 0x40);
+					/* sensor base for the pas106 */
+	/* set count and prefetch (cnd: 4 bits - mode: 4 bits) */
+	reg_w_val(gspca_dev, ET_I2C_COUNT, 0x11);
+	reg_w_val(gspca_dev, ET_I2C_REG, reg);	/* set the register base */
+	reg_w_val(gspca_dev, ET_I2C_PREFETCH, 0x02);	/* prefetch */
+	reg_w_val(gspca_dev, ET_I2C_PREFETCH, 0x00);
+	reg_r(gspca_dev, ET_I2C_DATA0, 1);	/* read one byte */
 	return 0;
 }
 
-static int Et_WaitStatus(struct usb_device *dev)
+static int Et_WaitStatus(struct gspca_dev *gspca_dev)
 {
-	__u8 bytereceived;
 	int retry = 10;
 
 	while (retry--) {
-		reg_r(dev, ET_ClCK, &bytereceived, 1);
-		if (bytereceived != 0)
+		reg_r(gspca_dev, ET_ClCK, 1);
+		if (gspca_dev->usb_buf[0] != 0)
 			return 1;
 	}
 	return 0;
 }
 
-static int et_video(struct usb_device *dev, int on)
+static int et_video(struct gspca_dev *gspca_dev,
+		    int on)
 {
-	int err;
+	int ret;
 
-	reg_w_val(dev, ET_GPIO_OUT, on
-				? 0x10		/* startvideo - set Bit5 */
-				: 0);		/* stopvideo */
-	err = Et_WaitStatus(dev);
-	if (!err)
+	reg_w_val(gspca_dev, ET_GPIO_OUT,
+		  on ? 0x10		/* startvideo - set Bit5 */
+		     : 0);		/* stopvideo */
+	ret = Et_WaitStatus(gspca_dev);
+	if (ret != 0)
 		PDEBUG(D_ERR, "timeout video on/off");
-	return err;
+	return ret;
 }
 
 static void Et_init2(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 value;
-	__u8 received;
 	static const __u8 FormLine[] = { 0x84, 0x03, 0x14, 0xf4, 0x01, 0x05 };
 
 	PDEBUG(D_STREAM, "Open Init2 ET");
-	reg_w_val(dev, ET_GPIO_DIR_CTRL, 0x2f);
-	reg_w_val(dev, ET_GPIO_OUT, 0x10);
-	reg_r(dev, ET_GPIO_IN, &received, 1);
-	reg_w_val(dev, ET_ClCK, 0x14);	/* 0x14 // 0x16 enabled pattern */
-	reg_w_val(dev, ET_CTRL, 0x1b);
+	reg_w_val(gspca_dev, ET_GPIO_DIR_CTRL, 0x2f);
+	reg_w_val(gspca_dev, ET_GPIO_OUT, 0x10);
+	reg_r(gspca_dev, ET_GPIO_IN, 1);
+	reg_w_val(gspca_dev, ET_ClCK, 0x14); /* 0x14 // 0x16 enabled pattern */
+	reg_w_val(gspca_dev, ET_CTRL, 0x1b);
 
 	/*  compression et subsampling */
 	if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
 		value = ET_COMP_VAL1;	/* 320 */
 	else
 		value = ET_COMP_VAL0;	/* 640 */
-	reg_w_val(dev, ET_COMP, value);
-	reg_w_val(dev, ET_MAXQt, 0x1f);
-	reg_w_val(dev, ET_MINQt, 0x04);
+	reg_w_val(gspca_dev, ET_COMP, value);
+	reg_w_val(gspca_dev, ET_MAXQt, 0x1f);
+	reg_w_val(gspca_dev, ET_MINQt, 0x04);
 	/* undocumented registers */
-	reg_w_val(dev, ET_REG1d, 0xff);
-	reg_w_val(dev, ET_REG1e, 0xff);
-	reg_w_val(dev, ET_REG1f, 0xff);
-	reg_w_val(dev, ET_REG20, 0x35);
-	reg_w_val(dev, ET_REG21, 0x01);
-	reg_w_val(dev, ET_REG22, 0x00);
-	reg_w_val(dev, ET_REG23, 0xff);
-	reg_w_val(dev, ET_REG24, 0xff);
-	reg_w_val(dev, ET_REG25, 0x0f);
+	reg_w_val(gspca_dev, ET_REG1d, 0xff);
+	reg_w_val(gspca_dev, ET_REG1e, 0xff);
+	reg_w_val(gspca_dev, ET_REG1f, 0xff);
+	reg_w_val(gspca_dev, ET_REG20, 0x35);
+	reg_w_val(gspca_dev, ET_REG21, 0x01);
+	reg_w_val(gspca_dev, ET_REG22, 0x00);
+	reg_w_val(gspca_dev, ET_REG23, 0xff);
+	reg_w_val(gspca_dev, ET_REG24, 0xff);
+	reg_w_val(gspca_dev, ET_REG25, 0x0f);
 	/* colors setting */
-	reg_w_val(dev, 0x30, 0x11);		/* 0x30 */
-	reg_w_val(dev, 0x31, 0x40);
-	reg_w_val(dev, 0x32, 0x00);
-	reg_w_val(dev, ET_O_RED, 0x00);		/* 0x34 */
-	reg_w_val(dev, ET_O_GREEN1, 0x00);
-	reg_w_val(dev, ET_O_BLUE, 0x00);
-	reg_w_val(dev, ET_O_GREEN2, 0x00);
+	reg_w_val(gspca_dev, 0x30, 0x11);		/* 0x30 */
+	reg_w_val(gspca_dev, 0x31, 0x40);
+	reg_w_val(gspca_dev, 0x32, 0x00);
+	reg_w_val(gspca_dev, ET_O_RED, 0x00);		/* 0x34 */
+	reg_w_val(gspca_dev, ET_O_GREEN1, 0x00);
+	reg_w_val(gspca_dev, ET_O_BLUE, 0x00);
+	reg_w_val(gspca_dev, ET_O_GREEN2, 0x00);
 	/*************/
-	reg_w_val(dev, ET_G_RED, 0x80);		/* 0x4d */
-	reg_w_val(dev, ET_G_GREEN1, 0x80);
-	reg_w_val(dev, ET_G_BLUE, 0x80);
-	reg_w_val(dev, ET_G_GREEN2, 0x80);
-	reg_w_val(dev, ET_G_GR_H, 0x00);
-	reg_w_val(dev, ET_G_GB_H, 0x00);		/* 0x52 */
+	reg_w_val(gspca_dev, ET_G_RED, 0x80);		/* 0x4d */
+	reg_w_val(gspca_dev, ET_G_GREEN1, 0x80);
+	reg_w_val(gspca_dev, ET_G_BLUE, 0x80);
+	reg_w_val(gspca_dev, ET_G_GREEN2, 0x80);
+	reg_w_val(gspca_dev, ET_G_GR_H, 0x00);
+	reg_w_val(gspca_dev, ET_G_GB_H, 0x00);		/* 0x52 */
 	/* Window control registers */
-	reg_w_val(dev, 0x61, 0x80);		/* use cmc_out */
-	reg_w_val(dev, 0x62, 0x02);
-	reg_w_val(dev, 0x63, 0x03);
-	reg_w_val(dev, 0x64, 0x14);
-	reg_w_val(dev, 0x65, 0x0e);
-	reg_w_val(dev, 0x66, 0x02);
-	reg_w_val(dev, 0x67, 0x02);
+	reg_w_val(gspca_dev, 0x61, 0x80);		/* use cmc_out */
+	reg_w_val(gspca_dev, 0x62, 0x02);
+	reg_w_val(gspca_dev, 0x63, 0x03);
+	reg_w_val(gspca_dev, 0x64, 0x14);
+	reg_w_val(gspca_dev, 0x65, 0x0e);
+	reg_w_val(gspca_dev, 0x66, 0x02);
+	reg_w_val(gspca_dev, 0x67, 0x02);
 
 	/**************************************/
-	reg_w_val(dev, ET_SYNCHRO, 0x8f);	/* 0x68 */
-	reg_w_val(dev, ET_STARTX, 0x69);		/* 0x6a //0x69 */
-	reg_w_val(dev, ET_STARTY, 0x0d);		/* 0x0d //0x0c */
-	reg_w_val(dev, ET_WIDTH_LOW, 0x80);
-	reg_w_val(dev, ET_HEIGTH_LOW, 0xe0);
-	reg_w_val(dev, ET_W_H_HEIGTH, 0x60);	/* 6d */
-	reg_w_val(dev, ET_REG6e, 0x86);
-	reg_w_val(dev, ET_REG6f, 0x01);
-	reg_w_val(dev, ET_REG70, 0x26);
-	reg_w_val(dev, ET_REG71, 0x7a);
-	reg_w_val(dev, ET_REG72, 0x01);
+	reg_w_val(gspca_dev, ET_SYNCHRO, 0x8f);		/* 0x68 */
+	reg_w_val(gspca_dev, ET_STARTX, 0x69);		/* 0x6a //0x69 */
+	reg_w_val(gspca_dev, ET_STARTY, 0x0d);		/* 0x0d //0x0c */
+	reg_w_val(gspca_dev, ET_WIDTH_LOW, 0x80);
+	reg_w_val(gspca_dev, ET_HEIGTH_LOW, 0xe0);
+	reg_w_val(gspca_dev, ET_W_H_HEIGTH, 0x60);	/* 6d */
+	reg_w_val(gspca_dev, ET_REG6e, 0x86);
+	reg_w_val(gspca_dev, ET_REG6f, 0x01);
+	reg_w_val(gspca_dev, ET_REG70, 0x26);
+	reg_w_val(gspca_dev, ET_REG71, 0x7a);
+	reg_w_val(gspca_dev, ET_REG72, 0x01);
 	/* Clock Pattern registers ***************** */
-	reg_w_val(dev, ET_REG73, 0x00);
-	reg_w_val(dev, ET_REG74, 0x18);		/* 0x28 */
-	reg_w_val(dev, ET_REG75, 0x0f);		/* 0x01 */
+	reg_w_val(gspca_dev, ET_REG73, 0x00);
+	reg_w_val(gspca_dev, ET_REG74, 0x18);		/* 0x28 */
+	reg_w_val(gspca_dev, ET_REG75, 0x0f);		/* 0x01 */
 	/**********************************************/
-	reg_w_val(dev, 0x8a, 0x20);
-	reg_w_val(dev, 0x8d, 0x0f);
-	reg_w_val(dev, 0x8e, 0x08);
+	reg_w_val(gspca_dev, 0x8a, 0x20);
+	reg_w_val(gspca_dev, 0x8d, 0x0f);
+	reg_w_val(gspca_dev, 0x8e, 0x08);
 	/**************************************/
-	reg_w_val(dev, 0x03, 0x08);
-	reg_w_val(dev, ET_PXL_CLK, 0x03);
-	reg_w_val(dev, 0x81, 0xff);
-	reg_w_val(dev, 0x80, 0x00);
-	reg_w_val(dev, 0x81, 0xff);
-	reg_w_val(dev, 0x80, 0x20);
-	reg_w_val(dev, 0x03, 0x01);
-	reg_w_val(dev, 0x03, 0x00);
-	reg_w_val(dev, 0x03, 0x08);
+	reg_w_val(gspca_dev, 0x03, 0x08);
+	reg_w_val(gspca_dev, ET_PXL_CLK, 0x03);
+	reg_w_val(gspca_dev, 0x81, 0xff);
+	reg_w_val(gspca_dev, 0x80, 0x00);
+	reg_w_val(gspca_dev, 0x81, 0xff);
+	reg_w_val(gspca_dev, 0x80, 0x20);
+	reg_w_val(gspca_dev, 0x03, 0x01);
+	reg_w_val(gspca_dev, 0x03, 0x00);
+	reg_w_val(gspca_dev, 0x03, 0x08);
 	/********************************************/
 
-/*	reg_r(dev, ET_I2C_BASE, &received, 1);
+/*	reg_r(gspca_dev, ET_I2C_BASE, 1);
 					 always 0x40 as the pas106 ??? */
 	/* set the sensor */
 	if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
@@ -435,25 +449,24 @@
 					 * 0x0b -> 24/(11+1) = 2 Mhz
 					 * 0x17 -> 24/(23+1) = 1 Mhz
 					 */
-	reg_w_val(dev, ET_PXL_CLK, value);
+	reg_w_val(gspca_dev, ET_PXL_CLK, value);
 	/* now set by fifo the FormatLine setting */
-	reg_w(dev, 0x62, FormLine, 6);
+	reg_w(gspca_dev, 0x62, FormLine, 6);
 
 	/* set exposure times [ 0..0x78] 0->longvalue 0x78->shortvalue */
-	reg_w_val(dev, 0x81, 0x47);		/* 0x47; */
-	reg_w_val(dev, 0x80, 0x40);		/* 0x40; */
+	reg_w_val(gspca_dev, 0x81, 0x47);	/* 0x47; */
+	reg_w_val(gspca_dev, 0x80, 0x40);	/* 0x40; */
 	/* Pedro change */
 	/* Brightness change Brith+ decrease value */
 	/* Brigth- increase value */
 	/* original value = 0x70; */
-	reg_w_val(dev, 0x81, 0x30);		/* 0x20; - set brightness */
-	reg_w_val(dev, 0x80, 0x20);		/* 0x20; */
+	reg_w_val(gspca_dev, 0x81, 0x30);	/* 0x20; - set brightness */
+	reg_w_val(gspca_dev, 0x80, 0x20);	/* 0x20; */
 }
 
 static void setcolors(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 I2cc[] = { 0x05, 0x02, 0x02, 0x05, 0x0d };
 	__u8 i2cflags = 0x01;
 	/* __u8 green = 0; */
@@ -464,8 +477,8 @@
 	/* green = 15 - ((((7*I2cc[0]) >> 2 ) + I2cc[3]) >> 1); */
 	/* I2cc[1] = I2cc[2] = green; */
 	if (sd->sensor == SENSOR_PAS106) {
-		Et_i2cwrite(dev, PAS106_REG13, &i2cflags, 1, 3);
-		Et_i2cwrite(dev, PAS106_REG9, I2cc, sizeof I2cc, 1);
+		i2c_w(gspca_dev, PAS106_REG13, &i2cflags, 1, 3);
+		i2c_w(gspca_dev, PAS106_REG9, I2cc, sizeof I2cc, 1);
 	}
 /*	PDEBUG(D_CONF , "Etoms red %d blue %d green %d",
 		I2cc[3], I2cc[0], green); */
@@ -474,21 +487,17 @@
 static void getcolors(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-/*	__u8 valblue; */
-	__u8 valred;
 
 	if (sd->sensor == SENSOR_PAS106) {
-/*		Et_i2cread(gspca_dev->dev, PAS106_REG9, &valblue, 1, 1); */
-		Et_i2cread(gspca_dev->dev, PAS106_REG9 + 3, &valred, 1, 1);
-		sd->colors = valred & 0x0f;
+/*		i2c_r(gspca_dev, PAS106_REG9);		 * blue */
+		i2c_r(gspca_dev, PAS106_REG9 + 3);	/* red */
+		sd->colors = gspca_dev->usb_buf[0] & 0x0f;
 	}
 }
 
 static void Et_init1(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 value;
-	__u8 received;
 /*	__u8 I2c0 [] = {0x0a, 0x12, 0x05, 0x22, 0xac, 0x00, 0x01, 0x00}; */
 	__u8 I2c0[] = { 0x0a, 0x12, 0x05, 0x6d, 0xcd, 0x00, 0x01, 0x00 };
 						/* try 1/120 0x6d 0xcd 0x40 */
@@ -496,12 +505,12 @@
 						 * 1/60000 hmm ?? */
 
 	PDEBUG(D_STREAM, "Open Init1 ET");
-	reg_w_val(dev, ET_GPIO_DIR_CTRL, 7);
-	reg_r(dev, ET_GPIO_IN, &received, 1);
-	reg_w_val(dev, ET_RESET_ALL, 1);
-	reg_w_val(dev, ET_RESET_ALL, 0);
-	reg_w_val(dev, ET_ClCK, 0x10);
-	reg_w_val(dev, ET_CTRL, 0x19);
+	reg_w_val(gspca_dev, ET_GPIO_DIR_CTRL, 7);
+	reg_r(gspca_dev, ET_GPIO_IN, 1);
+	reg_w_val(gspca_dev, ET_RESET_ALL, 1);
+	reg_w_val(gspca_dev, ET_RESET_ALL, 0);
+	reg_w_val(gspca_dev, ET_ClCK, 0x10);
+	reg_w_val(gspca_dev, ET_CTRL, 0x19);
 	/*   compression et subsampling */
 	if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv)
 		value = ET_COMP_VAL1;
@@ -510,80 +519,79 @@
 	PDEBUG(D_STREAM, "Open mode %d Compression %d",
 	       gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv,
 	       value);
-	reg_w_val(dev, ET_COMP, value);
-	reg_w_val(dev, ET_MAXQt, 0x1d);
-	reg_w_val(dev, ET_MINQt, 0x02);
+	reg_w_val(gspca_dev, ET_COMP, value);
+	reg_w_val(gspca_dev, ET_MAXQt, 0x1d);
+	reg_w_val(gspca_dev, ET_MINQt, 0x02);
 	/* undocumented registers */
-	reg_w_val(dev, ET_REG1d, 0xff);
-	reg_w_val(dev, ET_REG1e, 0xff);
-	reg_w_val(dev, ET_REG1f, 0xff);
-	reg_w_val(dev, ET_REG20, 0x35);
-	reg_w_val(dev, ET_REG21, 0x01);
-	reg_w_val(dev, ET_REG22, 0x00);
-	reg_w_val(dev, ET_REG23, 0xf7);
-	reg_w_val(dev, ET_REG24, 0xff);
-	reg_w_val(dev, ET_REG25, 0x07);
+	reg_w_val(gspca_dev, ET_REG1d, 0xff);
+	reg_w_val(gspca_dev, ET_REG1e, 0xff);
+	reg_w_val(gspca_dev, ET_REG1f, 0xff);
+	reg_w_val(gspca_dev, ET_REG20, 0x35);
+	reg_w_val(gspca_dev, ET_REG21, 0x01);
+	reg_w_val(gspca_dev, ET_REG22, 0x00);
+	reg_w_val(gspca_dev, ET_REG23, 0xf7);
+	reg_w_val(gspca_dev, ET_REG24, 0xff);
+	reg_w_val(gspca_dev, ET_REG25, 0x07);
 	/* colors setting */
-	reg_w_val(dev, ET_G_RED, 0x80);
-	reg_w_val(dev, ET_G_GREEN1, 0x80);
-	reg_w_val(dev, ET_G_BLUE, 0x80);
-	reg_w_val(dev, ET_G_GREEN2, 0x80);
-	reg_w_val(dev, ET_G_GR_H, 0x00);
-	reg_w_val(dev, ET_G_GB_H, 0x00);
+	reg_w_val(gspca_dev, ET_G_RED, 0x80);
+	reg_w_val(gspca_dev, ET_G_GREEN1, 0x80);
+	reg_w_val(gspca_dev, ET_G_BLUE, 0x80);
+	reg_w_val(gspca_dev, ET_G_GREEN2, 0x80);
+	reg_w_val(gspca_dev, ET_G_GR_H, 0x00);
+	reg_w_val(gspca_dev, ET_G_GB_H, 0x00);
 	/* Window control registers */
-	reg_w_val(dev, ET_SYNCHRO, 0xf0);
-	reg_w_val(dev, ET_STARTX, 0x56);		/* 0x56 */
-	reg_w_val(dev, ET_STARTY, 0x05);		/* 0x04 */
-	reg_w_val(dev, ET_WIDTH_LOW, 0x60);
-	reg_w_val(dev, ET_HEIGTH_LOW, 0x20);
-	reg_w_val(dev, ET_W_H_HEIGTH, 0x50);
-	reg_w_val(dev, ET_REG6e, 0x86);
-	reg_w_val(dev, ET_REG6f, 0x01);
-	reg_w_val(dev, ET_REG70, 0x86);
-	reg_w_val(dev, ET_REG71, 0x14);
-	reg_w_val(dev, ET_REG72, 0x00);
+	reg_w_val(gspca_dev, ET_SYNCHRO, 0xf0);
+	reg_w_val(gspca_dev, ET_STARTX, 0x56);		/* 0x56 */
+	reg_w_val(gspca_dev, ET_STARTY, 0x05);		/* 0x04 */
+	reg_w_val(gspca_dev, ET_WIDTH_LOW, 0x60);
+	reg_w_val(gspca_dev, ET_HEIGTH_LOW, 0x20);
+	reg_w_val(gspca_dev, ET_W_H_HEIGTH, 0x50);
+	reg_w_val(gspca_dev, ET_REG6e, 0x86);
+	reg_w_val(gspca_dev, ET_REG6f, 0x01);
+	reg_w_val(gspca_dev, ET_REG70, 0x86);
+	reg_w_val(gspca_dev, ET_REG71, 0x14);
+	reg_w_val(gspca_dev, ET_REG72, 0x00);
 	/* Clock Pattern registers */
-	reg_w_val(dev, ET_REG73, 0x00);
-	reg_w_val(dev, ET_REG74, 0x00);
-	reg_w_val(dev, ET_REG75, 0x0a);
-	reg_w_val(dev, ET_I2C_CLK, 0x04);
-	reg_w_val(dev, ET_PXL_CLK, 0x01);
+	reg_w_val(gspca_dev, ET_REG73, 0x00);
+	reg_w_val(gspca_dev, ET_REG74, 0x00);
+	reg_w_val(gspca_dev, ET_REG75, 0x0a);
+	reg_w_val(gspca_dev, ET_I2C_CLK, 0x04);
+	reg_w_val(gspca_dev, ET_PXL_CLK, 0x01);
 	/* set the sensor */
 	if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
 		I2c0[0] = 0x06;
-		Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof I2c0, 1);
-		Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof I2c2, 1);
+		i2c_w(gspca_dev, PAS106_REG2, I2c0, sizeof I2c0, 1);
+		i2c_w(gspca_dev, PAS106_REG9, I2c2, sizeof I2c2, 1);
 		value = 0x06;
-		Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1);
-		Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof I2c3, 1);
+		i2c_w(gspca_dev, PAS106_REG2, &value, 1, 1);
+		i2c_w(gspca_dev, PAS106_REG3, I2c3, sizeof I2c3, 1);
 		/* value = 0x1f; */
 		value = 0x04;
-		Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1);
+		i2c_w(gspca_dev, PAS106_REG0e, &value, 1, 1);
 	} else {
 		I2c0[0] = 0x0a;
 
-		Et_i2cwrite(dev, PAS106_REG2, I2c0, sizeof I2c0, 1);
-		Et_i2cwrite(dev, PAS106_REG9, I2c2, sizeof I2c2, 1);
+		i2c_w(gspca_dev, PAS106_REG2, I2c0, sizeof I2c0, 1);
+		i2c_w(gspca_dev, PAS106_REG9, I2c2, sizeof I2c2, 1);
 		value = 0x0a;
-
-		Et_i2cwrite(dev, PAS106_REG2, &value, 1, 1);
-		Et_i2cwrite(dev, PAS106_REG3, I2c3, sizeof I2c3, 1);
+		i2c_w(gspca_dev, PAS106_REG2, &value, 1, 1);
+		i2c_w(gspca_dev, PAS106_REG3, I2c3, sizeof I2c3, 1);
 		value = 0x04;
 		/* value = 0x10; */
-		Et_i2cwrite(dev, PAS106_REG0e, &value, 1, 1);
+		i2c_w(gspca_dev, PAS106_REG0e, &value, 1, 1);
 		/* bit 2 enable bit 1:2 select 0 1 2 3
 		   value = 0x07;                                * curve 0 *
-		   Et_i2cwrite(dev,PAS106_REG0f,&value,1,1);
+		   i2c_w(gspca_dev, PAS106_REG0f, &value, 1, 1);
 		 */
 	}
 
 /*	value = 0x01; */
 /*	value = 0x22; */
-/*	Et_i2cwrite(dev, PAS106_REG5, &value, 1, 1); */
+/*	i2c_w(gspca_dev, PAS106_REG5, &value, 1, 1); */
 	/* magnetude and sign bit for DAC */
-	Et_i2cwrite(dev, PAS106_REG7, I2c4, sizeof I2c4, 1);
+	i2c_w(gspca_dev, PAS106_REG7, I2c4, sizeof I2c4, 1);
 	/* now set by fifo the whole colors setting */
-	reg_w(dev, ET_G_RED, GainRGBG, 6);
+	reg_w(gspca_dev, ET_G_RED, GainRGBG, 6);
 	getcolors(gspca_dev);
 	setcolors(gspca_dev);
 }
@@ -632,14 +640,13 @@
 static int sd_open(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	if (sd->sensor == SENSOR_PAS106)
 		Et_init1(gspca_dev);
 	else
 		Et_init2(gspca_dev);
-	reg_w_val(dev, ET_RESET_ALL, 0x08);
-	et_video(dev, 0);		/* video off */
+	reg_w_val(gspca_dev, ET_RESET_ALL, 0x08);
+	et_video(gspca_dev, 0);		/* video off */
 	return 0;
 }
 
@@ -647,20 +654,19 @@
 static void sd_start(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	if (sd->sensor == SENSOR_PAS106)
 		Et_init1(gspca_dev);
 	else
 		Et_init2(gspca_dev);
 
-	reg_w_val(dev, ET_RESET_ALL, 0x08);
-	et_video(dev, 1);		/* video on */
+	reg_w_val(gspca_dev, ET_RESET_ALL, 0x08);
+	et_video(gspca_dev, 1);		/* video on */
 }
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
-	et_video(gspca_dev->dev, 0);	/* video off */
+	et_video(gspca_dev, 0);		/* video off */
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
@@ -678,7 +684,7 @@
 	__u8 brightness = sd->brightness;
 
 	for (i = 0; i < 4; i++)
-		reg_w_val(gspca_dev->dev, (ET_O_RED + i), brightness);
+		reg_w_val(gspca_dev, ET_O_RED + i, brightness);
 }
 
 static void getbrightness(struct gspca_dev *gspca_dev)
@@ -686,11 +692,10 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	int brightness = 0;
-	__u8 value;
 
 	for (i = 0; i < 4; i++) {
-		reg_r(gspca_dev->dev, (ET_O_RED + i), &value, 1);
-		brightness += value;
+		reg_r(gspca_dev, ET_O_RED + i, 1);
+		brightness += gspca_dev->usb_buf[0];
 	}
 	sd->brightness = brightness >> 3;
 }
@@ -701,8 +706,8 @@
 	__u8 RGBG[] = { 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 };
 	__u8 contrast = sd->contrast;
 
-	memset(RGBG, contrast, sizeof RGBG - 2);
-	reg_w(gspca_dev->dev, ET_G_RED, RGBG, 6);
+	memset(RGBG, contrast, sizeof(RGBG) - 2);
+	reg_w(gspca_dev, ET_G_RED, RGBG, 6);
 }
 
 static void getcontrast(struct gspca_dev *gspca_dev)
@@ -710,11 +715,10 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	int i;
 	int contrast = 0;
-	__u8 value = 0;
 
 	for (i = 0; i < 4; i++) {
-		reg_r(gspca_dev->dev, (ET_G_RED + i), &value, 1);
-		contrast += value;
+		reg_r(gspca_dev, ET_G_RED + i, 1);
+		contrast += gspca_dev->usb_buf[0];
 	}
 	sd->contrast = contrast >> 2;
 }
@@ -722,12 +726,11 @@
 static __u8 Et_getgainG(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	__u8 value = 0;
 
 	if (sd->sensor == SENSOR_PAS106) {
-		Et_i2cread(gspca_dev->dev, PAS106_REG0e, &value, 1, 1);
-		PDEBUG(D_CONF, "Etoms gain G %d", value);
-		return value;
+		i2c_r(gspca_dev, PAS106_REG0e);
+		PDEBUG(D_CONF, "Etoms gain G %d", gspca_dev->usb_buf[0]);
+		return gspca_dev->usb_buf[0];
 	}
 	return 0x1f;
 }
@@ -735,12 +738,12 @@
 static void Et_setgainG(struct gspca_dev *gspca_dev, __u8 gain)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 i2cflags = 0x01;
 
 	if (sd->sensor == SENSOR_PAS106) {
-		Et_i2cwrite(dev, PAS106_REG13, &i2cflags, 1, 3);
-		Et_i2cwrite(dev, PAS106_REG0e, &gain, 1, 1);
+		__u8 i2cflags = 0x01;
+
+		i2c_w(gspca_dev, PAS106_REG13, &i2cflags, 1, 3);
+		i2c_w(gspca_dev, PAS106_REG0e, &gain, 1, 1);
 	}
 }
 
@@ -751,8 +754,6 @@
 
 static void setautogain(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 GRBG[] = { 0, 0, 0, 0 };
 	__u8 luma = 0;
 	__u8 luma_mean = 128;
 	__u8 luma_delta = 20;
@@ -761,10 +762,10 @@
 	__u8 r, g, b;
 
 	Gbright = Et_getgainG(gspca_dev);
-	reg_r(dev, ET_LUMA_CENTER, GRBG, 4);
-	g = (GRBG[0] + GRBG[3]) >> 1;
-	r = GRBG[1];
-	b = GRBG[2];
+	reg_r(gspca_dev, ET_LUMA_CENTER, 4);
+	g = (gspca_dev->usb_buf[0] + gspca_dev->usb_buf[3]) >> 1;
+	r = gspca_dev->usb_buf[1];
+	b = gspca_dev->usb_buf[2];
 	r = ((r << 8) - (r << 4) - (r << 3)) >> 10;
 	b = ((b << 7) >> 10);
 	g = ((g << 9) + (g << 7) + (g << 5)) >> 10;
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index a566fd3..242f0fb 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -1347,9 +1347,11 @@
 		gspca_dev->fr_i,
 		gspca_dev->fr_o);
 
-	if (gspca_dev->sd_desc->dq_callback)
+	if (gspca_dev->sd_desc->dq_callback) {
+		mutex_lock(&gspca_dev->usb_lock);
 		gspca_dev->sd_desc->dq_callback(gspca_dev);
-
+		mutex_unlock(&gspca_dev->usb_lock);
+	}
 	return j;
 }
 
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h
index 78fccef..3fd2c4e 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -125,6 +125,7 @@
 	struct cam cam;				/* device information */
 	const struct sd_desc *sd_desc;		/* subdriver description */
 
+	__u8 usb_buf[8];			/* buffer for USB exchanges */
 	struct urb *urb[MAX_NURBS];
 
 	__u8 *frbuf;				/* buffer for nframes */
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index 23f3dba..88c2b02 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -24,8 +24,8 @@
 #include "gspca.h"
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/Mars USB Camera Driver");
@@ -83,39 +83,53 @@
 	REG_HW_MI_63,
 	REG_HW_MI_64,
 	REG_HW_MI_F1 = 0xf1,
-	ATTR_TOTAL_MI_REG = 242
+	ATTR_TOTAL_MI_REG = 0xf2
 };
 
-static int pcam_reg_write(struct usb_device *dev,
-			  __u16 index, __u8 *value, int len)
+/* the bytes to write are in gspca_dev->usb_buf */
+static int reg_w(struct gspca_dev *gspca_dev,
+		 __u16 index, int len)
 {
 	int rc;
 
-	rc = usb_control_msg(dev,
-			 usb_sndbulkpipe(dev, 4),
+	rc = usb_control_msg(gspca_dev->dev,
+			 usb_sndbulkpipe(gspca_dev->dev, 4),
 			 0x12,
-/*		?? 0xc8 = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_??? !? */
-			 0xc8,
+			 0xc8,		/* ?? */
 			 0,		/* value */
-			 index, value, len, 500);
+			 index, gspca_dev->usb_buf, len, 500);
 	if (rc < 0)
 		PDEBUG(D_ERR, "reg write [%02x] error %d", index, rc);
 	return rc;
 }
 
-static void MISensor_BulkWrite(struct usb_device *dev,
-				unsigned short *pch,
-				char Address)
+static int reg_w_buf(struct gspca_dev *gspca_dev,
+			__u16 index, __u8 *buf, int len)
 {
-	__u8 data[6];
+	int rc;
 
-	data[0] = 0x1f;
-	data[1] = 0;			/* control byte */
-	data[2] = Address;
-	data[3] = *pch >> 8;		/* high byte */
-	data[4] = *pch;			/* low byte */
+	rc = usb_control_msg(gspca_dev->dev,
+			 usb_sndbulkpipe(gspca_dev->dev, 4),
+			 0x12,
+			 0xc8,		/* ?? */
+			 0,		/* value */
+			 index, buf, len, 500);
+	if (rc < 0)
+		PDEBUG(D_ERR, "reg write [%02x] error %d", index, rc);
+	return rc;
+}
 
-	pcam_reg_write(dev, Address, data, 5);
+static void bulk_w(struct gspca_dev *gspca_dev,
+		   __u16 *pch,
+		   __u16 Address)
+{
+	gspca_dev->usb_buf[0] = 0x1f;
+	gspca_dev->usb_buf[1] = 0;			/* control byte */
+	gspca_dev->usb_buf[2] = Address;
+	gspca_dev->usb_buf[3] = *pch >> 8;		/* high byte */
+	gspca_dev->usb_buf[4] = *pch;			/* low byte */
+
+	reg_w(gspca_dev, Address, 5);
 }
 
 /* this function is called at probe time */
@@ -142,33 +156,30 @@
 
 static void sd_start(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int err_code;
-	__u8 data[12];
-	__u16 MI_buf[242];
+	__u8 *data;
+	__u16 *MI_buf;
 	int h_size, v_size;
 	int intpipe;
-/*	struct usb_device *dev = pcam->dev; */
-
-	memset(data, 0, sizeof data);
-	memset(MI_buf, 0, sizeof MI_buf);
 
 	PDEBUG(D_STREAM, "camera start, iface %d, alt 8", gspca_dev->iface);
-	if (usb_set_interface(dev, gspca_dev->iface, 8) < 0) {
+	if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 8) < 0) {
 		PDEBUG(D_ERR|D_STREAM, "Set packet size: set interface error");
 		return;
 	}
 
+	data = gspca_dev->usb_buf;
 	data[0] = 0x01;		/* address */
 	data[1] = 0x01;
 
-	err_code = pcam_reg_write(dev, data[0], data, 2);
+	err_code = reg_w(gspca_dev, data[0], 2);
 	if (err_code < 0)
 		return;
 
 	/*
 	   Initialize the MR97113 chip register
 	 */
+	data = kmalloc(16, GFP_KERNEL);
 	data[0] = 0x00;		/* address */
 	data[1] = 0x0c | 0x01;	/* reg 0 */
 	data[2] = 0x01;		/* reg 1 */
@@ -181,34 +192,34 @@
 	data[6] = 4;		/* reg 5, H start */
 	data[7] = 0xc0;		/* reg 6, gamma 1.5 */
 	data[8] = 3;		/* reg 7, V start */
-/*	if(h_size == 320 ) */
+/*	if (h_size == 320 ) */
 /*		data[9]= 0x56;	 * reg 8, 24MHz, 2:1 scale down */
 /*	else */
 	data[9] = 0x52;		/* reg 8, 24MHz, no scale down */
 	data[10] = 0x5d;	/* reg 9, I2C device address
 				 *	[for PAS5101 (0x40)] [for MI (0x5d)] */
 
-	err_code = pcam_reg_write(dev, data[0], data, 11);
+	err_code = reg_w_buf(gspca_dev, data[0], data, 11);
+	kfree(data);
 	if (err_code < 0)
 		return;
 
+	data = gspca_dev->usb_buf;
 	data[0] = 0x23;		/* address */
 	data[1] = 0x09;		/* reg 35, append frame header */
 
-	err_code = pcam_reg_write(dev, data[0], data, 2);
-	if (err_code < 0) {
-		PDEBUG(D_ERR, "Register write failed");
+	err_code = reg_w(gspca_dev, data[0], 2);
+	if (err_code < 0)
 		return;
-	}
 
-	data[0] = 0x3C;		/* address */
-/*	if (pcam->width == 1280) */
+	data[0] = 0x3c;		/* address */
+/*	if (gspca_dev->width == 1280) */
 /*		data[1] = 200;	 * reg 60, pc-cam frame size
 				 *	(unit: 4KB) 800KB */
 /*	else */
 	data[1] = 50;		/* 50 reg 60, pc-cam frame size
 				 *	(unit: 4KB) 200KB */
-	err_code = pcam_reg_write(dev, data[0], data, 2);
+	err_code = reg_w(gspca_dev, data[0], 2);
 	if (err_code < 0)
 		return;
 
@@ -250,19 +261,20 @@
 	/* auto dark-gain */
 	data[0] = 0x5e;		/* address */
 
-	err_code = pcam_reg_write(dev, data[0], data, 6);
+	err_code = reg_w(gspca_dev, data[0], 6);
 	if (err_code < 0)
 		return;
 
 	data[0] = 0x67;
 	data[1] = 0x13;		/* reg 103, first pixel B, disable sharpness */
-	err_code = pcam_reg_write(dev, data[0], data, 2);
+	err_code = reg_w(gspca_dev, data[0], 2);
 	if (err_code < 0)
 		return;
 
 	/*
 	 * initialize the value of MI sensor...
 	 */
+	MI_buf = kzalloc(ATTR_TOTAL_MI_REG * sizeof *MI_buf, GFP_KERNEL);
 	MI_buf[REG_HW_MI_1] = 0x000a;
 	MI_buf[REG_HW_MI_2] = 0x000c;
 	MI_buf[REG_HW_MI_3] = 0x0405;
@@ -304,48 +316,48 @@
 	}
 	MI_buf[0x20] = 0x1104;
 
-	MISensor_BulkWrite(dev, MI_buf + 1, 1);
-	MISensor_BulkWrite(dev, MI_buf + 2, 2);
-	MISensor_BulkWrite(dev, MI_buf + 3, 3);
-	MISensor_BulkWrite(dev, MI_buf + 4, 4);
-	MISensor_BulkWrite(dev, MI_buf + 5, 5);
-	MISensor_BulkWrite(dev, MI_buf + 6, 6);
-	MISensor_BulkWrite(dev, MI_buf + 7, 7);
-	MISensor_BulkWrite(dev, MI_buf + 9, 9);
-	MISensor_BulkWrite(dev, MI_buf + 0x0b, 0x0b);
-	MISensor_BulkWrite(dev, MI_buf + 0x0c, 0x0c);
-	MISensor_BulkWrite(dev, MI_buf + 0x0d, 0x0d);
-	MISensor_BulkWrite(dev, MI_buf + 0x1e, 0x1e);
-	MISensor_BulkWrite(dev, MI_buf + 0x20, 0x20);
-	MISensor_BulkWrite(dev, MI_buf + 0x2b, 0x2b);
-	MISensor_BulkWrite(dev, MI_buf + 0x2c, 0x2c);
-	MISensor_BulkWrite(dev, MI_buf + 0x2d, 0x2d);
-	MISensor_BulkWrite(dev, MI_buf + 0x2e, 0x2e);
-	MISensor_BulkWrite(dev, MI_buf + 0x35, 0x35);
-	MISensor_BulkWrite(dev, MI_buf + 0x5f, 0x5f);
-	MISensor_BulkWrite(dev, MI_buf + 0x60, 0x60);
-	MISensor_BulkWrite(dev, MI_buf + 0x61, 0x61);
-	MISensor_BulkWrite(dev, MI_buf + 0x62, 0x62);
-	MISensor_BulkWrite(dev, MI_buf + 0x63, 0x63);
-	MISensor_BulkWrite(dev, MI_buf + 0x64, 0x64);
-	MISensor_BulkWrite(dev, MI_buf + 0xf1, 0xf1);
+	bulk_w(gspca_dev, MI_buf + 1, 1);
+	bulk_w(gspca_dev, MI_buf + 2, 2);
+	bulk_w(gspca_dev, MI_buf + 3, 3);
+	bulk_w(gspca_dev, MI_buf + 4, 4);
+	bulk_w(gspca_dev, MI_buf + 5, 5);
+	bulk_w(gspca_dev, MI_buf + 6, 6);
+	bulk_w(gspca_dev, MI_buf + 7, 7);
+	bulk_w(gspca_dev, MI_buf + 9, 9);
+	bulk_w(gspca_dev, MI_buf + 0x0b, 0x0b);
+	bulk_w(gspca_dev, MI_buf + 0x0c, 0x0c);
+	bulk_w(gspca_dev, MI_buf + 0x0d, 0x0d);
+	bulk_w(gspca_dev, MI_buf + 0x1e, 0x1e);
+	bulk_w(gspca_dev, MI_buf + 0x20, 0x20);
+	bulk_w(gspca_dev, MI_buf + 0x2b, 0x2b);
+	bulk_w(gspca_dev, MI_buf + 0x2c, 0x2c);
+	bulk_w(gspca_dev, MI_buf + 0x2d, 0x2d);
+	bulk_w(gspca_dev, MI_buf + 0x2e, 0x2e);
+	bulk_w(gspca_dev, MI_buf + 0x35, 0x35);
+	bulk_w(gspca_dev, MI_buf + 0x5f, 0x5f);
+	bulk_w(gspca_dev, MI_buf + 0x60, 0x60);
+	bulk_w(gspca_dev, MI_buf + 0x61, 0x61);
+	bulk_w(gspca_dev, MI_buf + 0x62, 0x62);
+	bulk_w(gspca_dev, MI_buf + 0x63, 0x63);
+	bulk_w(gspca_dev, MI_buf + 0x64, 0x64);
+	bulk_w(gspca_dev, MI_buf + 0xf1, 0xf1);
+	kfree(MI_buf);
 
-	intpipe = usb_sndintpipe(dev, 0);
-	err_code = usb_clear_halt(dev, intpipe);
+	intpipe = usb_sndintpipe(gspca_dev->dev, 0);
+	err_code = usb_clear_halt(gspca_dev->dev, intpipe);
 
 	data[0] = 0x00;
 	data[1] = 0x4d;		/* ISOC transfering enable... */
-	pcam_reg_write(dev, data[0], data, 2);
+	reg_w(gspca_dev, data[0], 2);
 }
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
 	int result;
-	__u8 data[2];
 
-	data[0] = 1;
-	data[1] = 0;
-	result = pcam_reg_write(gspca_dev->dev, data[0], data, 2);
+	gspca_dev->usb_buf[0] = 1;
+	gspca_dev->usb_buf[1] = 0;
+	result = reg_w(gspca_dev, gspca_dev->usb_buf[0], 2);
 	if (result < 0)
 		PDEBUG(D_ERR, "Camera Stop failed");
 }
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index ba245ba..08d99c3 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -24,8 +24,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("OV519 USB Camera Driver");
@@ -282,15 +282,14 @@
 static int reg_w(struct sd *sd, __u16 index, __u8 value)
 {
 	int ret;
-	__u8 data;
 
-	data = value;
+	sd->gspca_dev.usb_buf[0] = value;
 	ret = usb_control_msg(sd->gspca_dev.dev,
 			usb_sndctrlpipe(sd->gspca_dev.dev, 0),
 			1,			/* REQ_IO (ov518/519) */
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0, index,
-			&data, 1, 500);
+			sd->gspca_dev.usb_buf, 1, 500);
 	if (ret < 0)
 		PDEBUG(D_ERR, "Write reg [%02x] %02x failed", index, value);
 	return ret;
@@ -301,16 +300,15 @@
 static int reg_r(struct sd *sd, __u16 index)
 {
 	int ret;
-	__u8 data;
 
 	ret = usb_control_msg(sd->gspca_dev.dev,
 			usb_rcvctrlpipe(sd->gspca_dev.dev, 0),
 			1,			/* REQ_IO */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			0, index, &data, 1, 500);
+			0, index, sd->gspca_dev.usb_buf, 1, 500);
 
 	if (ret >= 0)
-		ret = data;
+		ret = sd->gspca_dev.usb_buf[0];
 	else
 		PDEBUG(D_ERR, "Read reg [0x%02x] failed", index);
 	return ret;
@@ -321,16 +319,15 @@
 		  __u16 index)
 {
 	int ret;
-	__u8 buf[8];
 
 	ret = usb_control_msg(sd->gspca_dev.dev,
 			usb_rcvctrlpipe(sd->gspca_dev.dev, 0),
 			1,			/* REQ_IO */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			0, index, &buf[0], 8, 500);
+			0, index, sd->gspca_dev.usb_buf, 8, 500);
 
 	if (ret >= 0)
-		ret = buf[0];
+		ret = sd->gspca_dev.usb_buf[0];
 	else
 		PDEBUG(D_ERR, "Read reg 8 [0x%02x] failed", index);
 	return ret;
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c
index 5d68d3f..fa7abc4 100644
--- a/drivers/media/video/gspca/pac207.c
+++ b/drivers/media/video/gspca/pac207.c
@@ -27,8 +27,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Hans de Goede <j.w.r.degoede@hhs.nl>");
 MODULE_DESCRIPTION("Pixart PAC207");
@@ -187,18 +187,18 @@
 static const unsigned char pac207_sof_marker[5] =
 		{ 0xff, 0xff, 0x00, 0xff, 0x96 };
 
-int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
+static int pac207_write_regs(struct gspca_dev *gspca_dev, u16 index,
 	const u8 *buffer, u16 length)
 {
 	struct usb_device *udev = gspca_dev->dev;
 	int err;
-	u8 kbuf[8];
 
-	memcpy(kbuf, buffer, length);
+	memcpy(gspca_dev->usb_buf, buffer, length);
 
 	err = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x01,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			0x00, index, kbuf, length, PAC207_CTRL_TIMEOUT);
+			0x00, index,
+			gspca_dev->usb_buf, length, PAC207_CTRL_TIMEOUT);
 	if (err < 0)
 		PDEBUG(D_ERR,
 			"Failed to write registers to index 0x%04X, error %d)",
@@ -227,12 +227,12 @@
 int pac207_read_reg(struct gspca_dev *gspca_dev, u16 index)
 {
 	struct usb_device *udev = gspca_dev->dev;
-	u8 buff;
 	int res;
 
 	res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), 0x00,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
-			0x00, index, &buff, 1, PAC207_CTRL_TIMEOUT);
+			0x00, index,
+			gspca_dev->usb_buf, 1, PAC207_CTRL_TIMEOUT);
 	if (res < 0) {
 		PDEBUG(D_ERR,
 			"Failed to read a register (index 0x%04X, error %d)",
@@ -240,10 +240,9 @@
 		return res;
 	}
 
-	return buff;
+	return gspca_dev->usb_buf[0];
 }
 
-
 /* this function is called at probe time */
 static int sd_config(struct gspca_dev *gspca_dev,
 			const struct usb_device_id *id)
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index 1a2347a..5c052e3 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -23,8 +23,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Thomas Kaiser thomas@kaiser-linux.li");
 MODULE_DESCRIPTION("Pixart PAC7311");
@@ -206,46 +206,43 @@
 	0x11, 0x00, 0x3f, 0x00
 };
 
-static void reg_w(struct usb_device *dev,
+static void reg_w_buf(struct gspca_dev *gspca_dev,
 		  __u16 index,
 		  const char *buffer, __u16 len)
 {
-	__u8 tmpbuf[8];
-
-	memcpy(tmpbuf, buffer, len);
-	usb_control_msg(dev,
-			usb_sndctrlpipe(dev, 0),
+	memcpy(gspca_dev->usb_buf, buffer, len);
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			1,		/* request */
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
-			index, tmpbuf, len,
+			index, gspca_dev->usb_buf, len,
 			500);
 }
 
-static void pac7311_reg_read(struct usb_device *dev, __u16 index,
-			    __u8 *buffer)
+static __u8 reg_r(struct gspca_dev *gspca_dev,
+			     __u16 index)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,			/* request */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,			/* value */
-			index, buffer, 1,
+			index, gspca_dev->usb_buf, 1,
 			500);
+	return gspca_dev->usb_buf[0];
 }
 
-static void pac7311_reg_write(struct usb_device *dev,
-			      __u16 index,
-			      __u8 value)
+static void reg_w(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  __u8 value)
 {
-	__u8 buf;
-
-	buf = value;
-	usb_control_msg(dev,
-			usb_sndctrlpipe(dev, 0),
+	gspca_dev->usb_buf[0] = value;
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			0,			/* request */
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			value, index, &buf, 1,
+			value, index, gspca_dev->usb_buf, 1,
 			500);
 }
 
@@ -254,20 +251,19 @@
 			const struct usb_device_id *id)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	struct cam *cam;
 
 	PDEBUG(D_CONF, "Find Sensor PAC7311");
-	pac7311_reg_write(dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0xff, 0x04);
-	pac7311_reg_write(dev, 0x27, 0x80);
-	pac7311_reg_write(dev, 0x28, 0xca);
-	pac7311_reg_write(dev, 0x29, 0x53);
-	pac7311_reg_write(dev, 0x2a, 0x0e);
-	pac7311_reg_write(dev, 0xff, 0x01);
-	pac7311_reg_write(dev, 0x3e, 0x20);
+	reg_w(gspca_dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x40); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0xff, 0x04);
+	reg_w(gspca_dev, 0x27, 0x80);
+	reg_w(gspca_dev, 0x28, 0xca);
+	reg_w(gspca_dev, 0x29, 0x53);
+	reg_w(gspca_dev, 0x2a, 0x0e);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x3e, 0x20);
 
 	cam = &gspca_dev->cam;
 	cam->dev_name = (char *) id->driver_info;
@@ -289,11 +285,11 @@
 
 /*jfm: inverted?*/
 	brightness = BRIGHTNESS_MAX - sd->brightness;
-	pac7311_reg_write(gspca_dev->dev, 0xff, 0x04);
-/*	pac7311_reg_write(gspca_dev->dev, 0x0e, 0x00); */
-	pac7311_reg_write(gspca_dev->dev, 0x0f, brightness);
+	reg_w(gspca_dev, 0xff, 0x04);
+/*	reg_w(gspca_dev, 0x0e, 0x00); */
+	reg_w(gspca_dev, 0x0f, brightness);
 	/* load registers to sensor (Bit 0, auto clear) */
-	pac7311_reg_write(gspca_dev->dev, 0x11, 0x01);
+	reg_w(gspca_dev, 0x11, 0x01);
 	PDEBUG(D_CONF|D_STREAM, "brightness: %i", brightness);
 }
 
@@ -301,10 +297,10 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	pac7311_reg_write(gspca_dev->dev, 0xff, 0x01);
-	pac7311_reg_write(gspca_dev->dev, 0x80, sd->contrast);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x80, sd->contrast);
 	/* load registers to sensor (Bit 0, auto clear) */
-	pac7311_reg_write(gspca_dev->dev, 0x11, 0x01);
+	reg_w(gspca_dev, 0x11, 0x01);
 	PDEBUG(D_CONF|D_STREAM, "contrast: %i", sd->contrast);
 }
 
@@ -312,94 +308,93 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	pac7311_reg_write(gspca_dev->dev, 0xff, 0x01);
-	pac7311_reg_write(gspca_dev->dev, 0x10, sd->colors);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x10, sd->colors);
 	/* load registers to sensor (Bit 0, auto clear) */
-	pac7311_reg_write(gspca_dev->dev, 0x11, 0x01);
+	reg_w(gspca_dev, 0x11, 0x01);
 	PDEBUG(D_CONF|D_STREAM, "color: %i", sd->colors);
 }
 
 /* this function is called at open time */
 static int sd_open(struct gspca_dev *gspca_dev)
 {
-	pac7311_reg_write(gspca_dev->dev, 0x78, 0x00);	/* Turn on LED */
+	reg_w(gspca_dev, 0x78, 0x00);	/* Turn on LED */
 	return 0;
 }
 
 static void sd_start(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	pac7311_reg_write(dev, 0xff, 0x01);
-	reg_w(dev, 0x0002, "\x48\x0a\x40\x08\x00\x00\x08\x00", 8);
-	reg_w(dev, 0x000a, "\x06\xff\x11\xff\x5a\x30\x90\x4c", 8);
-	reg_w(dev, 0x0012, "\x00\x07\x00\x0a\x10\x00\xa0\x10", 8);
-	reg_w(dev, 0x001a, "\x02\x00\x00\x00\x00\x0b\x01\x00", 8);
-	reg_w(dev, 0x0022, "\x00\x00\x00\x00\x00\x00\x00\x00", 8);
-	reg_w(dev, 0x002a, "\x00\x00\x00", 3);
-	reg_w(dev, 0x003e, "\x00\x00\x78\x52\x4a\x52\x78\x6e", 8);
-	reg_w(dev, 0x0046, "\x48\x46\x48\x6e\x5f\x49\x42\x49", 8);
-	reg_w(dev, 0x004e, "\x5f\x5f\x49\x42\x49\x5f\x6e\x48", 8);
-	reg_w(dev, 0x0056, "\x46\x48\x6e\x78\x52\x4a\x52\x78", 8);
-	reg_w(dev, 0x005e, "\x00\x00\x09\x1b\x34\x49\x5c\x9b", 8);
-	reg_w(dev, 0x0066, "\xd0\xff", 2);
-	reg_w(dev, 0x0078, "\x44\x00\xf2\x01\x01\x80", 6);
-	reg_w(dev, 0x007f, "\x2a\x1c\x00\xc8\x02\x58\x03\x84", 8);
-	reg_w(dev, 0x0087, "\x12\x00\x1a\x04\x08\x0c\x10\x14", 8);
-	reg_w(dev, 0x008f, "\x18\x20", 2);
-	reg_w(dev, 0x0096, "\x01\x08\x04", 3);
-	reg_w(dev, 0x00a0, "\x44\x44\x44\x04", 4);
-	reg_w(dev, 0x00f0, "\x01\x00\x00\x00\x22\x00\x20\x00", 8);
-	reg_w(dev, 0x00f8, "\x3f\x00\x0a\x01\x00", 5);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w_buf(gspca_dev, 0x0002, "\x48\x0a\x40\x08\x00\x00\x08\x00", 8);
+	reg_w_buf(gspca_dev, 0x000a, "\x06\xff\x11\xff\x5a\x30\x90\x4c", 8);
+	reg_w_buf(gspca_dev, 0x0012, "\x00\x07\x00\x0a\x10\x00\xa0\x10", 8);
+	reg_w_buf(gspca_dev, 0x001a, "\x02\x00\x00\x00\x00\x0b\x01\x00", 8);
+	reg_w_buf(gspca_dev, 0x0022, "\x00\x00\x00\x00\x00\x00\x00\x00", 8);
+	reg_w_buf(gspca_dev, 0x002a, "\x00\x00\x00", 3);
+	reg_w_buf(gspca_dev, 0x003e, "\x00\x00\x78\x52\x4a\x52\x78\x6e", 8);
+	reg_w_buf(gspca_dev, 0x0046, "\x48\x46\x48\x6e\x5f\x49\x42\x49", 8);
+	reg_w_buf(gspca_dev, 0x004e, "\x5f\x5f\x49\x42\x49\x5f\x6e\x48", 8);
+	reg_w_buf(gspca_dev, 0x0056, "\x46\x48\x6e\x78\x52\x4a\x52\x78", 8);
+	reg_w_buf(gspca_dev, 0x005e, "\x00\x00\x09\x1b\x34\x49\x5c\x9b", 8);
+	reg_w_buf(gspca_dev, 0x0066, "\xd0\xff", 2);
+	reg_w_buf(gspca_dev, 0x0078, "\x44\x00\xf2\x01\x01\x80", 6);
+	reg_w_buf(gspca_dev, 0x007f, "\x2a\x1c\x00\xc8\x02\x58\x03\x84", 8);
+	reg_w_buf(gspca_dev, 0x0087, "\x12\x00\x1a\x04\x08\x0c\x10\x14", 8);
+	reg_w_buf(gspca_dev, 0x008f, "\x18\x20", 2);
+	reg_w_buf(gspca_dev, 0x0096, "\x01\x08\x04", 3);
+	reg_w_buf(gspca_dev, 0x00a0, "\x44\x44\x44\x04", 4);
+	reg_w_buf(gspca_dev, 0x00f0, "\x01\x00\x00\x00\x22\x00\x20\x00", 8);
+	reg_w_buf(gspca_dev, 0x00f8, "\x3f\x00\x0a\x01\x00", 5);
 
-	pac7311_reg_write(dev, 0xff, 0x04);
-	pac7311_reg_write(dev, 0x02, 0x04);
-	pac7311_reg_write(dev, 0x03, 0x54);
-	pac7311_reg_write(dev, 0x04, 0x07);
-	pac7311_reg_write(dev, 0x05, 0x2b);
-	pac7311_reg_write(dev, 0x06, 0x09);
-	pac7311_reg_write(dev, 0x07, 0x0f);
-	pac7311_reg_write(dev, 0x08, 0x09);
-	pac7311_reg_write(dev, 0x09, 0x00);
-	pac7311_reg_write(dev, 0x0c, 0x07);
-	pac7311_reg_write(dev, 0x0d, 0x00);
-	pac7311_reg_write(dev, 0x0e, 0x00);
-	pac7311_reg_write(dev, 0x0f, 0x62);
-	pac7311_reg_write(dev, 0x10, 0x08);
-	pac7311_reg_write(dev, 0x12, 0x07);
-	pac7311_reg_write(dev, 0x13, 0x00);
-	pac7311_reg_write(dev, 0x14, 0x00);
-	pac7311_reg_write(dev, 0x15, 0x00);
-	pac7311_reg_write(dev, 0x16, 0x00);
-	pac7311_reg_write(dev, 0x17, 0x00);
-	pac7311_reg_write(dev, 0x18, 0x00);
-	pac7311_reg_write(dev, 0x19, 0x00);
-	pac7311_reg_write(dev, 0x1a, 0x00);
-	pac7311_reg_write(dev, 0x1b, 0x03);
-	pac7311_reg_write(dev, 0x1c, 0xa0);
-	pac7311_reg_write(dev, 0x1d, 0x01);
-	pac7311_reg_write(dev, 0x1e, 0xf4);
-	pac7311_reg_write(dev, 0x21, 0x00);
-	pac7311_reg_write(dev, 0x22, 0x08);
-	pac7311_reg_write(dev, 0x24, 0x03);
-	pac7311_reg_write(dev, 0x26, 0x00);
-	pac7311_reg_write(dev, 0x27, 0x01);
-	pac7311_reg_write(dev, 0x28, 0xca);
-	pac7311_reg_write(dev, 0x29, 0x10);
-	pac7311_reg_write(dev, 0x2a, 0x06);
-	pac7311_reg_write(dev, 0x2b, 0x78);
-	pac7311_reg_write(dev, 0x2c, 0x00);
-	pac7311_reg_write(dev, 0x2d, 0x00);
-	pac7311_reg_write(dev, 0x2e, 0x00);
-	pac7311_reg_write(dev, 0x2f, 0x00);
-	pac7311_reg_write(dev, 0x30, 0x23);
-	pac7311_reg_write(dev, 0x31, 0x28);
-	pac7311_reg_write(dev, 0x32, 0x04);
-	pac7311_reg_write(dev, 0x33, 0x11);
-	pac7311_reg_write(dev, 0x34, 0x00);
-	pac7311_reg_write(dev, 0x35, 0x00);
-	pac7311_reg_write(dev, 0x11, 0x01);
+	reg_w(gspca_dev, 0xff, 0x04);
+	reg_w(gspca_dev, 0x02, 0x04);
+	reg_w(gspca_dev, 0x03, 0x54);
+	reg_w(gspca_dev, 0x04, 0x07);
+	reg_w(gspca_dev, 0x05, 0x2b);
+	reg_w(gspca_dev, 0x06, 0x09);
+	reg_w(gspca_dev, 0x07, 0x0f);
+	reg_w(gspca_dev, 0x08, 0x09);
+	reg_w(gspca_dev, 0x09, 0x00);
+	reg_w(gspca_dev, 0x0c, 0x07);
+	reg_w(gspca_dev, 0x0d, 0x00);
+	reg_w(gspca_dev, 0x0e, 0x00);
+	reg_w(gspca_dev, 0x0f, 0x62);
+	reg_w(gspca_dev, 0x10, 0x08);
+	reg_w(gspca_dev, 0x12, 0x07);
+	reg_w(gspca_dev, 0x13, 0x00);
+	reg_w(gspca_dev, 0x14, 0x00);
+	reg_w(gspca_dev, 0x15, 0x00);
+	reg_w(gspca_dev, 0x16, 0x00);
+	reg_w(gspca_dev, 0x17, 0x00);
+	reg_w(gspca_dev, 0x18, 0x00);
+	reg_w(gspca_dev, 0x19, 0x00);
+	reg_w(gspca_dev, 0x1a, 0x00);
+	reg_w(gspca_dev, 0x1b, 0x03);
+	reg_w(gspca_dev, 0x1c, 0xa0);
+	reg_w(gspca_dev, 0x1d, 0x01);
+	reg_w(gspca_dev, 0x1e, 0xf4);
+	reg_w(gspca_dev, 0x21, 0x00);
+	reg_w(gspca_dev, 0x22, 0x08);
+	reg_w(gspca_dev, 0x24, 0x03);
+	reg_w(gspca_dev, 0x26, 0x00);
+	reg_w(gspca_dev, 0x27, 0x01);
+	reg_w(gspca_dev, 0x28, 0xca);
+	reg_w(gspca_dev, 0x29, 0x10);
+	reg_w(gspca_dev, 0x2a, 0x06);
+	reg_w(gspca_dev, 0x2b, 0x78);
+	reg_w(gspca_dev, 0x2c, 0x00);
+	reg_w(gspca_dev, 0x2d, 0x00);
+	reg_w(gspca_dev, 0x2e, 0x00);
+	reg_w(gspca_dev, 0x2f, 0x00);
+	reg_w(gspca_dev, 0x30, 0x23);
+	reg_w(gspca_dev, 0x31, 0x28);
+	reg_w(gspca_dev, 0x32, 0x04);
+	reg_w(gspca_dev, 0x33, 0x11);
+	reg_w(gspca_dev, 0x34, 0x00);
+	reg_w(gspca_dev, 0x35, 0x00);
+	reg_w(gspca_dev, 0x11, 0x01);
 	setcontrast(gspca_dev);
 	setbrightness(gspca_dev);
 	setcolors(gspca_dev);
@@ -407,39 +402,39 @@
 	/* set correct resolution */
 	switch (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
 	case 2:					/* 160x120 */
-		pac7311_reg_write(dev, 0xff, 0x04);
-		pac7311_reg_write(dev, 0x02, 0x03);
-		pac7311_reg_write(dev, 0xff, 0x01);
-		pac7311_reg_write(dev, 0x08, 0x09);
-		pac7311_reg_write(dev, 0x17, 0x20);
-		pac7311_reg_write(dev, 0x1b, 0x00);
-/*		pac7311_reg_write(dev, 0x80, 0x69); */
-		pac7311_reg_write(dev, 0x87, 0x10);
+		reg_w(gspca_dev, 0xff, 0x04);
+		reg_w(gspca_dev, 0x02, 0x03);
+		reg_w(gspca_dev, 0xff, 0x01);
+		reg_w(gspca_dev, 0x08, 0x09);
+		reg_w(gspca_dev, 0x17, 0x20);
+		reg_w(gspca_dev, 0x1b, 0x00);
+/*		reg_w(gspca_dev, 0x80, 0x69); */
+		reg_w(gspca_dev, 0x87, 0x10);
 		break;
 	case 1:					/* 320x240 */
-		pac7311_reg_write(dev, 0xff, 0x04);
-		pac7311_reg_write(dev, 0x02, 0x03);
-		pac7311_reg_write(dev, 0xff, 0x01);
-		pac7311_reg_write(dev, 0x08, 0x09);
-		pac7311_reg_write(dev, 0x17, 0x30);
-/*		pac7311_reg_write(dev, 0x80, 0x3f); */
-		pac7311_reg_write(dev, 0x87, 0x11);
+		reg_w(gspca_dev, 0xff, 0x04);
+		reg_w(gspca_dev, 0x02, 0x03);
+		reg_w(gspca_dev, 0xff, 0x01);
+		reg_w(gspca_dev, 0x08, 0x09);
+		reg_w(gspca_dev, 0x17, 0x30);
+/*		reg_w(gspca_dev, 0x80, 0x3f); */
+		reg_w(gspca_dev, 0x87, 0x11);
 		break;
 	case 0:					/* 640x480 */
-		pac7311_reg_write(dev, 0xff, 0x04);
-		pac7311_reg_write(dev, 0x02, 0x03);
-		pac7311_reg_write(dev, 0xff, 0x01);
-		pac7311_reg_write(dev, 0x08, 0x08);
-		pac7311_reg_write(dev, 0x17, 0x00);
-/*		pac7311_reg_write(dev, 0x80, 0x1c); */
-		pac7311_reg_write(dev, 0x87, 0x12);
+		reg_w(gspca_dev, 0xff, 0x04);
+		reg_w(gspca_dev, 0x02, 0x03);
+		reg_w(gspca_dev, 0xff, 0x01);
+		reg_w(gspca_dev, 0x08, 0x08);
+		reg_w(gspca_dev, 0x17, 0x00);
+/*		reg_w(gspca_dev, 0x80, 0x1c); */
+		reg_w(gspca_dev, 0x87, 0x12);
 		break;
 	}
 
 	/* start stream */
-	pac7311_reg_write(dev, 0xff, 0x01);
-	pac7311_reg_write(dev, 0x78, 0x04);
-	pac7311_reg_write(dev, 0x78, 0x05);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x78, 0x04);
+	reg_w(gspca_dev, 0x78, 0x05);
 
 	if (sd->autogain) {
 		sd->ag_cnt = AG_CNT_START;
@@ -451,18 +446,16 @@
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-
-	pac7311_reg_write(dev, 0xff, 0x04);
-	pac7311_reg_write(dev, 0x27, 0x80);
-	pac7311_reg_write(dev, 0x28, 0xca);
-	pac7311_reg_write(dev, 0x29, 0x53);
-	pac7311_reg_write(dev, 0x2a, 0x0e);
-	pac7311_reg_write(dev, 0xff, 0x01);
-	pac7311_reg_write(dev, 0x3e, 0x20);
-	pac7311_reg_write(dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0xff, 0x04);
+	reg_w(gspca_dev, 0x27, 0x80);
+	reg_w(gspca_dev, 0x28, 0xca);
+	reg_w(gspca_dev, 0x29, 0x53);
+	reg_w(gspca_dev, 0x2a, 0x0e);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x3e, 0x20);
+	reg_w(gspca_dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
@@ -472,18 +465,16 @@
 /* this function is called at close time */
 static void sd_close(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-
-	pac7311_reg_write(dev, 0xff, 0x04);
-	pac7311_reg_write(dev, 0x27, 0x80);
-	pac7311_reg_write(dev, 0x28, 0xca);
-	pac7311_reg_write(dev, 0x29, 0x53);
-	pac7311_reg_write(dev, 0x2a, 0x0e);
-	pac7311_reg_write(dev, 0xff, 0x01);
-	pac7311_reg_write(dev, 0x3e, 0x20);
-	pac7311_reg_write(dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
-	pac7311_reg_write(dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0xff, 0x04);
+	reg_w(gspca_dev, 0x27, 0x80);
+	reg_w(gspca_dev, 0x28, 0xca);
+	reg_w(gspca_dev, 0x29, 0x53);
+	reg_w(gspca_dev, 0x2a, 0x0e);
+	reg_w(gspca_dev, 0xff, 0x01);
+	reg_w(gspca_dev, 0x3e, 0x20);
+	reg_w(gspca_dev, 0x78, 0x04); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
+	reg_w(gspca_dev, 0x78, 0x44); /* Bit_0=start stream, Bit_7=LED */
 }
 
 static void setautogain(struct gspca_dev *gspca_dev, int luma)
@@ -491,11 +482,9 @@
 	int luma_mean = 128;
 	int luma_delta = 20;
 	__u8 spring = 5;
-	__u8 Pxclk;
 	int Gbright;
 
-	pac7311_reg_read(gspca_dev->dev, 0x02, &Pxclk);
-	Gbright = Pxclk;
+	Gbright = reg_r(gspca_dev, 0x02);
 	PDEBUG(D_FRAM, "luma mean %d", luma);
 	if (luma < luma_mean - luma_delta ||
 	    luma > luma_mean + luma_delta) {
@@ -505,10 +494,10 @@
 		else if (Gbright < 4)
 			Gbright = 4;
 		PDEBUG(D_FRAM, "gbright %d", Gbright);
-		pac7311_reg_write(gspca_dev->dev, 0xff, 0x04);
-		pac7311_reg_write(gspca_dev->dev, 0x0f, Gbright);
+		reg_w(gspca_dev, 0xff, 0x04);
+		reg_w(gspca_dev, 0x0f, Gbright);
 		/* load registers to sensor (Bit 0, auto clear) */
-		pac7311_reg_write(gspca_dev->dev, 0x11, 0x01);
+		reg_w(gspca_dev, 0x11, 0x01);
 	}
 }
 
@@ -623,11 +612,8 @@
 
 static void getbrightness(struct gspca_dev *gspca_dev)
 {
-/*	__u8 brightness = 0;
-
-	pac7311_reg_read(gspca_dev->dev, 0x0008, &brightness);
-	spca50x->brightness = brightness;
-	return spca50x->brightness;	*/
+/*	sd->brightness = reg_r(gspca_dev, 0x08);
+	return sd->brightness;	*/
 /*	PDEBUG(D_CONF, "Called pac7311_getbrightness: Not implemented yet"); */
 }
 
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 5d23131..ce8b28f 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -384,64 +384,82 @@
 	{0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10},
 };
 
-static void reg_r(struct usb_device *dev,
-			 __u16 value, __u8 *buffer)
+/* get one byte in gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 value)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,			/* request */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 			value,
 			0,			/* index */
-			buffer, 1,
+			gspca_dev->usb_buf, 1,
 			500);
 }
 
-static void reg_w(struct usb_device *dev,
-			  __u16 value,
-			  const __u8 *buffer,
-			  int len)
+static void reg_w(struct gspca_dev *gspca_dev,
+		  __u16 value,
+		  const __u8 *buffer,
+		  int len)
 {
-	__u8 tmpbuf[48];
-
 #ifdef CONFIG_VIDEO_ADV_DEBUG
-	if (len > sizeof tmpbuf) {
+	if (len > sizeof gspca_dev->usb_buf) {
 		PDEBUG(D_ERR|D_PACK, "reg_w: buffer overflow");
 		return;
 	}
 #endif
+	memcpy(gspca_dev->usb_buf, buffer, len);
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
+			0x08,			/* request */
+			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
+			value,
+			0,			/* index */
+			gspca_dev->usb_buf, len,
+			500);
+}
+
+static void reg_w_big(struct gspca_dev *gspca_dev,
+		  __u16 value,
+		  const __u8 *buffer,
+		  int len)
+{
+	__u8 *tmpbuf;
+
+	tmpbuf = kmalloc(len, GFP_KERNEL);
 	memcpy(tmpbuf, buffer, len);
-	usb_control_msg(dev,
-			usb_sndctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			0x08,			/* request */
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 			value,
 			0,			/* index */
 			tmpbuf, len,
 			500);
+	kfree(tmpbuf);
 }
 
-static int i2c_w(struct usb_device *dev, const __u8 *buffer)
+static int i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer)
 {
 	int retry = 60;
-	__u8 ByteReceive;
 
 	/* is i2c ready */
-	reg_w(dev, 0x08, buffer, 8);
+	reg_w(gspca_dev, 0x08, buffer, 8);
 	while (retry--) {
 		msleep(10);
-		reg_r(dev, 0x08, &ByteReceive);
-		if (ByteReceive == 4)
+		reg_r(gspca_dev, 0x08);
+		if (gspca_dev->usb_buf[0] == 4)
 			return 0;
 	}
 	return -1;
 }
 
-static void i2c_w_vector(struct usb_device *dev,
+static void i2c_w_vector(struct gspca_dev *gspca_dev,
 			const __u8 buffer[][8], int len)
 {
 	for (;;) {
-		reg_w(dev, 0x08, *buffer, 8);
+		reg_w(gspca_dev, 0x08, *buffer, 8);
 		len -= 8;
 		if (len <= 0)
 			break;
@@ -460,7 +478,7 @@
 			{0xa0, 0x60, 0x06, 0x11, 0x99, 0x04, 0x94, 0x15};
 
 		i2cOV6650[3] = sd->brightness;
-		if (i2c_w(gspca_dev->dev, i2cOV6650) < 0)
+		if (i2c_w(gspca_dev, i2cOV6650) < 0)
 			 goto err;
 		break;
 	    }
@@ -470,7 +488,7 @@
 
 		/* change reg 0x06 */
 		i2cOV[3] = sd->brightness;
-		if (i2c_w(gspca_dev->dev, i2cOV) < 0)
+		if (i2c_w(gspca_dev, i2cOV) < 0)
 			goto err;
 		break;
 	    }
@@ -480,11 +498,11 @@
 
 		i2c1[3] = sd->brightness >> 3;
 		i2c1[2] = 0x0e;
-		if (i2c_w(gspca_dev->dev, i2c1) < 0)
+		if (i2c_w(gspca_dev, i2c1) < 0)
 			goto err;
 		i2c1[3] = 0x01;
 		i2c1[2] = 0x13;
-		if (i2c_w(gspca_dev->dev, i2c1) < 0)
+		if (i2c_w(gspca_dev, i2c1) < 0)
 			goto err;
 		break;
 	    }
@@ -500,18 +518,18 @@
 
 		/* change reg 0x10 */
 		i2cpexpo[4] = 0xff - sd->brightness;
-/*		if(i2c_w(gspca_dev->dev,i2cpexpo1) < 0)
+/*		if(i2c_w(gspca_dev,i2cpexpo1) < 0)
 			goto err; */
-/*		if(i2c_w(gspca_dev->dev,i2cpdoit) < 0)
+/*		if(i2c_w(gspca_dev,i2cpdoit) < 0)
 			goto err; */
-		if (i2c_w(gspca_dev->dev, i2cpexpo) < 0)
+		if (i2c_w(gspca_dev, i2cpexpo) < 0)
 			goto err;
-		if (i2c_w(gspca_dev->dev, i2cpdoit) < 0)
+		if (i2c_w(gspca_dev, i2cpdoit) < 0)
 			goto err;
 		i2cp202[3] = sd->brightness >> 3;
-		if (i2c_w(gspca_dev->dev, i2cp202) < 0)
+		if (i2c_w(gspca_dev, i2cp202) < 0)
 			goto err;
-		if (i2c_w(gspca_dev->dev, i2cpdoit) < 0)
+		if (i2c_w(gspca_dev, i2cpdoit) < 0)
 			goto err;
 		break;
 	    }
@@ -522,7 +540,7 @@
 		value = 0xff - sd->brightness;
 		i2c[4] = value;
 		PDEBUG(D_CONF, "brightness %d : %d", value, i2c[4]);
-		if (i2c_w(gspca_dev->dev, i2c) < 0)
+		if (i2c_w(gspca_dev, i2c) < 0)
 			goto err;
 		break;
 	    }
@@ -551,14 +569,14 @@
 			{0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10};
 
 		i2c[4] = 255 - gain;
-		if (i2c_w(gspca_dev->dev, i2c) < 0)
+		if (i2c_w(gspca_dev, i2c) < 0)
 			goto err;
 		break;
 	    }
 	case SENSOR_OV6650: {
 		__u8 i2c[] = {0xa0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
 		i2c[3] = gain;
-		if (i2c_w(gspca_dev->dev, i2c) < 0)
+		if (i2c_w(gspca_dev, i2c) < 0)
 			goto err;
 		break;
 	    }
@@ -578,10 +596,10 @@
 
 	/* red and blue gain */
 	rgb_value = gain << 4 | gain;
-	reg_w(gspca_dev->dev, 0x10, &rgb_value, 1);
+	reg_w(gspca_dev, 0x10, &rgb_value, 1);
 	/* green gain */
 	rgb_value = gain;
-	reg_w(gspca_dev->dev, 0x11, &rgb_value, 1);
+	reg_w(gspca_dev, 0x11, &rgb_value, 1);
 
 	if (sd->sensor_has_gain)
 		setsensorgain(gspca_dev);
@@ -604,7 +622,7 @@
 		if (reg > 15)
 			reg = 15;
 		reg = (reg << 4) | 0x0b;
-		reg_w(gspca_dev->dev, 0x19, &reg, 1);
+		reg_w(gspca_dev, 0x19, &reg, 1);
 		break;
 	    }
 	case SENSOR_OV6650: {
@@ -613,7 +631,7 @@
 		if (i2c[3] > 15)
 			i2c[3] = 15;
 		i2c[3] |= 0xc0;
-		if (i2c_w(gspca_dev->dev, i2c) < 0)
+		if (i2c_w(gspca_dev, i2c) < 0)
 			PDEBUG(D_ERR, "i2c error exposure");
 		break;
 	    }
@@ -721,22 +739,20 @@
 	sd->exposure = EXPOSURE_DEF;
 	sd->autogain = AUTOGAIN_DEF;
 	if (sd->sensor == SENSOR_OV7630_3)	/* jfm: from win trace */
-		reg_w(gspca_dev->dev, 0x01, probe_ov7630, sizeof probe_ov7630);
+		reg_w(gspca_dev, 0x01, probe_ov7630, sizeof probe_ov7630);
 	return 0;
 }
 
 /* this function is called at open time */
 static int sd_open(struct gspca_dev *gspca_dev)
 {
-	__u8 ByteReceive;
-
-	reg_r(gspca_dev->dev, 0x00, &ByteReceive);
-	if (ByteReceive != 0x10)
+	reg_r(gspca_dev, 0x00);
+	if (gspca_dev->usb_buf[0] != 0x10)
 		return -ENODEV;
 	return 0;
 }
 
-static void pas106_i2cinit(struct usb_device *dev)
+static void pas106_i2cinit(struct gspca_dev *gspca_dev)
 {
 	int i;
 	const __u8 *data;
@@ -747,7 +763,7 @@
 	while (--i >= 0) {
 		memcpy(&i2c1[2], data, 2);
 					/* copy 2 bytes from the template */
-		if (i2c_w(dev, i2c1) < 0)
+		if (i2c_w(gspca_dev, i2c1) < 0)
 			PDEBUG(D_ERR, "i2c error pas106");
 		data += 2;
 	}
@@ -757,7 +773,6 @@
 static void sd_start(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	int mode, l;
 	const __u8 *sn9c10x;
 	__u8 reg01, reg17;
@@ -835,75 +850,75 @@
 	}
 
 	/* reg 0x01 bit 2 video transfert on */
-	reg_w(dev, 0x01, &reg01, 1);
+	reg_w(gspca_dev, 0x01, &reg01, 1);
 	/* reg 0x17 SensorClk enable inv Clk 0x60 */
-	reg_w(dev, 0x17, &reg17, 1);
+	reg_w(gspca_dev, 0x17, &reg17, 1);
 /*fixme: for ov7630 102
-	reg_w(dev, 0x01, {0x06, sn9c10x[1]}, 2); */
+	reg_w(gspca_dev, 0x01, {0x06, sn9c10x[1]}, 2); */
 	/* Set the registers from the template */
-	reg_w(dev, 0x01, sn9c10x, l);
+	reg_w_big(gspca_dev, 0x01, sn9c10x, l);
 	switch (sd->sensor) {
 	case SENSOR_HV7131R:
-		i2c_w_vector(dev, hv7131_sensor_init,
+		i2c_w_vector(gspca_dev, hv7131_sensor_init,
 				sizeof hv7131_sensor_init);
 		break;
 	case SENSOR_OV6650:
-		i2c_w_vector(dev, ov6650_sensor_init,
+		i2c_w_vector(gspca_dev, ov6650_sensor_init,
 				sizeof ov6650_sensor_init);
 		break;
 	case SENSOR_OV7630:
-		i2c_w_vector(dev, ov7630_sensor_init_com,
+		i2c_w_vector(gspca_dev, ov7630_sensor_init_com,
 				sizeof ov7630_sensor_init_com);
 		msleep(200);
-		i2c_w_vector(dev, ov7630_sensor_init,
+		i2c_w_vector(gspca_dev, ov7630_sensor_init,
 				sizeof ov7630_sensor_init);
 		break;
 	case SENSOR_OV7630_3:
-		i2c_w_vector(dev, ov7630_sensor_init_com,
+		i2c_w_vector(gspca_dev, ov7630_sensor_init_com,
 				sizeof ov7630_sensor_init_com);
 		msleep(200);
-		i2c_w_vector(dev, ov7630_sensor_init_3,
+		i2c_w_vector(gspca_dev, ov7630_sensor_init_3,
 				sizeof ov7630_sensor_init_3);
 		break;
 	case SENSOR_PAS106:
-		pas106_i2cinit(dev);
+		pas106_i2cinit(gspca_dev);
 		break;
 	case SENSOR_PAS202:
-		i2c_w_vector(dev, pas202_sensor_init,
+		i2c_w_vector(gspca_dev, pas202_sensor_init,
 				sizeof pas202_sensor_init);
 		break;
 	case SENSOR_TAS5110:
-		i2c_w_vector(dev, tas5110_sensor_init,
+		i2c_w_vector(gspca_dev, tas5110_sensor_init,
 				sizeof tas5110_sensor_init);
 		break;
 	default:
 /*	case SENSOR_TAS5130CXX: */
-		i2c_w_vector(dev, tas5130_sensor_init,
+		i2c_w_vector(gspca_dev, tas5130_sensor_init,
 				sizeof tas5130_sensor_init);
 		break;
 	}
 	/* H_size V_size  0x28, 0x1e maybe 640x480 */
-	reg_w(dev, 0x15, reg15, 2);
+	reg_w(gspca_dev, 0x15, reg15, 2);
 	/* compression register */
-	reg_w(dev, 0x18, &reg17_19[1], 1);
+	reg_w(gspca_dev, 0x18, &reg17_19[1], 1);
 	if (sd->sensor != SENSOR_OV7630_3) {
 		/* H_start */
-		reg_w(dev, 0x12, &sn9c10x[0x12 - 1], 1);
+		reg_w(gspca_dev, 0x12, &sn9c10x[0x12 - 1], 1);
 		/* V_START */
-		reg_w(dev, 0x13, &sn9c10x[0x13 - 1], 1);
+		reg_w(gspca_dev, 0x13, &sn9c10x[0x13 - 1], 1);
 	}
 	/* reset 0x17 SensorClk enable inv Clk 0x60 */
 				/*fixme: ov7630 [17]=68 8f (+20 if 102)*/
-	reg_w(dev, 0x17, &reg17_19[0], 1);
+	reg_w(gspca_dev, 0x17, &reg17_19[0], 1);
 	/*MCKSIZE ->3 */	/*fixme: not ov7630*/
 	if (sd->sensor != SENSOR_OV7630_3)
-		reg_w(dev, 0x19, &reg17_19[2], 1);
+		reg_w(gspca_dev, 0x19, &reg17_19[2], 1);
 	/* AE_STRX AE_STRY AE_ENDX AE_ENDY */
-	reg_w(dev, 0x1c, &sn9c10x[0x1c - 1], 4);
+	reg_w(gspca_dev, 0x1c, &sn9c10x[0x1c - 1], 4);
 	/* Enable video transfert */
-	reg_w(dev, 0x01, &sn9c10x[0], 1);
+	reg_w(gspca_dev, 0x01, &sn9c10x[0], 1);
 	/* Compression */
-	reg_w(dev, 0x18, &reg17_19[1], 2);
+	reg_w(gspca_dev, 0x18, &reg17_19[1], 2);
 	msleep(20);
 
 	setgain(gspca_dev);
@@ -919,7 +934,7 @@
 	__u8 ByteSend;
 
 	ByteSend = 0x09;	/* 0X00 */
-	reg_w(gspca_dev->dev, 0x01, &ByteSend, 1);
+	reg_w(gspca_dev, 0x01, &ByteSend, 1);
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 4cb1421..30e840d 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -24,8 +24,8 @@
 #include "gspca.h"
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SONIX JPEG USB Camera Driver");
@@ -512,42 +512,40 @@
 	0x29, 0x29, 0x29, 0x29
 };
 
-static void reg_r(struct usb_device *dev,
-		  __u16 value,
-		  __u8 *buffer, int len)
+/* read <len> bytes (len < sizeof gspca_dev->usb_buf) to gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 value, int len)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 			value, 0,
-			buffer, len,
+			gspca_dev->usb_buf, len,
 			500);
 }
 
-static void reg_w(struct usb_device *dev,
+static void reg_w(struct gspca_dev *gspca_dev,
 			  __u16 value,
 			  const __u8 *buffer,
 			  int len)
 {
-	if (len < 16) {
-		__u8 tmpbuf[16];
-
-		memcpy(tmpbuf, buffer, len);
-		usb_control_msg(dev,
-				usb_sndctrlpipe(dev, 0),
+	if (len <= sizeof gspca_dev->usb_buf) {
+		memcpy(gspca_dev->usb_buf, buffer, len);
+		usb_control_msg(gspca_dev->dev,
+				usb_sndctrlpipe(gspca_dev->dev, 0),
 				0x08,
 			   USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 				value, 0,
-				tmpbuf, len,
+				gspca_dev->usb_buf, len,
 				500);
 	} else {
 		__u8 *tmpbuf;
 
 		tmpbuf = kmalloc(len, GFP_KERNEL);
 		memcpy(tmpbuf, buffer, len);
-		usb_control_msg(dev,
-				usb_sndctrlpipe(dev, 0),
+		usb_control_msg(gspca_dev->dev,
+				usb_sndctrlpipe(gspca_dev->dev, 0),
 				0x08,
 			   USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 				value, 0,
@@ -557,12 +555,11 @@
 	}
 }
 
-/* write 2 bytes */
+/* I2C write 2 bytes */
 static void i2c_w2(struct gspca_dev *gspca_dev,
 		   const __u8 *buffer)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 mode[8];
 
 	/* is i2c ready */
@@ -574,22 +571,21 @@
 	mode[5] = 0;
 	mode[6] = 0;
 	mode[7] = 0x10;
-	reg_w(dev, 0x08, mode, 8);
+	reg_w(gspca_dev, 0x08, mode, 8);
 }
 
-/* write 8 bytes */
-static void i2c_w8(struct usb_device *dev, const __u8 *buffer)
+/* I2C write 8 bytes */
+static void i2c_w8(struct gspca_dev *gspca_dev,
+		   const __u8 *buffer)
 {
-	reg_w(dev, 0x08, buffer, 8);
+	reg_w(gspca_dev, 0x08, buffer, 8);
 	msleep(1);
 }
 
-/* read 5 bytes */
-static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg,
-		   __u8 *buffer)
+/* read 5 bytes in gspca_dev->usb_buf */
+static void i2c_r5(struct gspca_dev *gspca_dev, __u8 reg)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 mode[8];
 
 	mode[0] = sd->i2c_ctrl_reg | 0x10;
@@ -600,40 +596,39 @@
 	mode[5] = 0;
 	mode[6] = 0;
 	mode[7] = 0x10;
-	i2c_w8(dev, mode);
+	i2c_w8(gspca_dev, mode);
 	mode[0] = sd->i2c_ctrl_reg | (5 << 4) | 0x02;
 	mode[2] = 0;
-	i2c_w8(dev, mode);
-	reg_r(dev, 0x0a, buffer, 5);
+	i2c_w8(gspca_dev, mode);
+	reg_r(gspca_dev, 0x0a, 5);
 }
 
 static int probesensor(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 reg02;
 	static const __u8 datasend[] = { 2, 0 };
 	/* reg val1 val2 val3 val4 */
-	__u8 datarecd[6];
 
 	i2c_w2(gspca_dev, datasend);
 /* should write 0xa1 0x11 0x02 0x00 0x00 0x00 0x00 the 0x10 is add by i2cw */
 	msleep(10);
 	reg02 = 0x66;
-	reg_w(dev, 0x02, &reg02, 1);		/* Gpio on */
+	reg_w(gspca_dev, 0x02, &reg02, 1);		/* Gpio on */
 	msleep(10);
-	i2c_r5(gspca_dev, 0, datarecd);		/* read sensor id */
-	if (datarecd[0] == 0x02
-	    && datarecd[1] == 0x09
-	    && datarecd[2] == 0x01
-	    && datarecd[3] == 0x00
-	    && datarecd[4] == 0x00) {
+	i2c_r5(gspca_dev, 0);				/* read sensor id */
+	if (gspca_dev->usb_buf[0] == 0x02
+	    && gspca_dev->usb_buf[1] == 0x09
+	    && gspca_dev->usb_buf[2] == 0x01
+	    && gspca_dev->usb_buf[3] == 0x00
+	    && gspca_dev->usb_buf[4] == 0x00) {
 		PDEBUG(D_PROBE, "Find Sensor sn9c102P HV7131R");
 		sd->sensor = SENSOR_HV7131R;
 		return SENSOR_HV7131R;
 	}
 	PDEBUG(D_PROBE, "Find Sensor %d %d %d",
-		datarecd[0], datarecd[1], datarecd[2]);
+		gspca_dev->usb_buf[0], gspca_dev->usb_buf[1],
+		gspca_dev->usb_buf[2]);
 	PDEBUG(D_PROBE, "Sensor sn9c102P Not found");
 	return -ENODEV;
 }
@@ -642,7 +637,6 @@
 			  const __u8 *sn9c1xx)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 data;
 	__u8 regF1;
 	const __u8 *reg9a;
@@ -655,14 +649,15 @@
 
 
 	regF1 = 0x00;
-	reg_w(dev, 0xf1, &regF1, 1);
+	reg_w(gspca_dev, 0xf1, &regF1, 1);
 
-	reg_w(dev, 0x01, &sn9c1xx[0], 1);	/*fixme:jfm was [1] en v1*/
+	reg_w(gspca_dev, 0x01, &sn9c1xx[0], 1);
+						/*fixme:jfm was [1] en v1*/
 
 	/* configure gpio */
-	reg_w(dev, 0x01, &sn9c1xx[1], 2);
-	reg_w(dev, 0x08, &sn9c1xx[8], 2);
-	reg_w(dev, 0x17, &sn9c1xx[0x17], 3);
+	reg_w(gspca_dev, 0x01, &sn9c1xx[1], 2);
+	reg_w(gspca_dev, 0x08, &sn9c1xx[8], 2);
+	reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 3);
 	switch (sd->customid) {
 	case SN9C325:
 		reg9a = reg9a_sn9c325;
@@ -674,37 +669,37 @@
 		reg9a = reg9a_def;
 		break;
 	}
-	reg_w(dev, 0x9a, reg9a, 6);
+	reg_w(gspca_dev, 0x9a, reg9a, 6);
 
 	data = 0x60;				/*fixme:jfm 60 00 00 (3) */
-	reg_w(dev, 0xd4, &data, 1);
+	reg_w(gspca_dev, 0xd4, &data, 1);
 
-	reg_w(dev, 0x03, &sn9c1xx[3], 0x0f);
+	reg_w(gspca_dev, 0x03, &sn9c1xx[3], 0x0f);
 
 	switch (sd->customid) {
 	case SN9C120:				/* from win trace */
 		data = 0x61;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 		data = 0x20;
-		reg_w(dev, 0x17, &data, 1);
+		reg_w(gspca_dev, 0x17, &data, 1);
 		data = 0x60;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 		break;
 	case SN9C325:
 		data = 0x43;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 		data = 0xae;
-		reg_w(dev, 0x17, &data, 1);
+		reg_w(gspca_dev, 0x17, &data, 1);
 		data = 0x42;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 		break;
 	default:
 		data = 0x43;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 		data = 0x61;
-		reg_w(dev, 0x17, &data, 1);
+		reg_w(gspca_dev, 0x17, &data, 1);
 		data = 0x42;
-		reg_w(dev, 0x01, &data, 1);
+		reg_w(gspca_dev, 0x01, &data, 1);
 	}
 
 	if (sd->sensor == SENSOR_HV7131R) {
@@ -717,24 +712,22 @@
 static void hv7131R_InitSensor(struct gspca_dev *gspca_dev)
 {
 	int i = 0;
-	struct usb_device *dev = gspca_dev->dev;
 	static const __u8 SetSensorClk[] =	/* 0x08 Mclk */
 		{ 0xa1, 0x11, 0x01, 0x18, 0x00, 0x00, 0x00, 0x10 };
 
 	while (hv7131r_sensor_init[i][0]) {
-		i2c_w8(dev, hv7131r_sensor_init[i]);
+		i2c_w8(gspca_dev, hv7131r_sensor_init[i]);
 		i++;
 	}
-	i2c_w8(dev, SetSensorClk);
+	i2c_w8(gspca_dev, SetSensorClk);
 }
 
 static void mi0360_InitSensor(struct gspca_dev *gspca_dev)
 {
 	int i = 0;
-	struct usb_device *dev = gspca_dev->dev;
 
 	while (mi0360_sensor_init[i][0]) {
-		i2c_w8(dev, mi0360_sensor_init[i]);
+		i2c_w8(gspca_dev, mi0360_sensor_init[i]);
 		i++;
 	}
 }
@@ -742,21 +735,19 @@
 static void mo4000_InitSensor(struct gspca_dev *gspca_dev)
 {
 	int i = 0;
-	struct usb_device *dev = gspca_dev->dev;
 
 	while (mo4000_sensor_init[i][0]) {
-		i2c_w8(dev, mo4000_sensor_init[i]);
+		i2c_w8(gspca_dev, mo4000_sensor_init[i]);
 		i++;
 	}
 }
 
 static void ov7648_InitSensor(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int i = 0;
 
 	while (ov7648_sensor_init[i][0]) {
-		i2c_w8(dev, ov7648_sensor_init[i]);
+		i2c_w8(gspca_dev, ov7648_sensor_init[i]);
 		i++;
 	}
 }
@@ -764,10 +755,9 @@
 static void ov7660_InitSensor(struct gspca_dev *gspca_dev)
 {
 	int i = 0;
-	struct usb_device *dev = gspca_dev->dev;
 
 	while (ov7660_sensor_init[i][0]) {
-		i2c_w8(dev, ov7660_sensor_init[i]);
+		i2c_w8(gspca_dev, ov7660_sensor_init[i]);
 		i++;
 	}
 }
@@ -1005,51 +995,52 @@
 static int sd_open(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 /*	const __u8 *sn9c1xx; */
 	__u8 regF1;
 	__u8 regGpio[] = { 0x29, 0x74 };
 
 	/* setup a selector by customid */
 	regF1 = 0x01;
-	reg_w(dev, 0xf1, &regF1, 1);
-	reg_r(dev, 0x00, &regF1, 1);	/* -> regF1 = 0x00 */
-	reg_w(dev, 0xf1, &regF1, 1);
-	reg_r(dev, 0x00, &regF1, 1);
+	reg_w(gspca_dev, 0xf1, &regF1, 1);
+	reg_r(gspca_dev, 0x00, 1);		/* -> regF1 = 0x00 */
+	regF1 = gspca_dev->usb_buf[0];
+	reg_w(gspca_dev, 0xf1, &regF1, 1);
+	reg_r(gspca_dev, 0x00, 1);
+	regF1 = gspca_dev->usb_buf[0];
 	switch (sd->customid) {
 	case SN9C102P:
 		if (regF1 != 0x11)
 			return -ENODEV;
-		reg_w(dev, 0x02, &regGpio[1], 1);
+		reg_w(gspca_dev, 0x02, &regGpio[1], 1);
 		break;
 	case SN9C105:
 		if (regF1 != 0x11)
 			return -ENODEV;
-		reg_w(dev, 0x02, regGpio, 2);
+		reg_w(gspca_dev, 0x02, regGpio, 2);
 		break;
 	case SN9C110:
 		if (regF1 != 0x12)
 			return -ENODEV;
 		regGpio[1] = 0x62;
-		reg_w(dev, 0x02, &regGpio[1], 1);
+		reg_w(gspca_dev, 0x02, &regGpio[1], 1);
 		break;
 	case SN9C120:
 		if (regF1 != 0x12)
 			return -ENODEV;
 		regGpio[1] = 0x70;
-		reg_w(dev, 0x02, regGpio, 2);
+		reg_w(gspca_dev, 0x02, regGpio, 2);
 		break;
 	default:
 /*	case SN9C325: */
 		if (regF1 != 0x12)
 			return -ENODEV;
 		regGpio[1] = 0x62;
-		reg_w(dev, 0x02, &regGpio[1], 1);
+		reg_w(gspca_dev, 0x02, &regGpio[1], 1);
 		break;
 	}
 
 	regF1 = 0x01;
-	reg_w(dev, 0xf1, &regF1, 1);
+	reg_w(gspca_dev, 0xf1, &regF1, 1);
 
 	return 0;
 }
@@ -1073,7 +1064,7 @@
 		Expodoit[3] = expo >> 16;
 		Expodoit[4] = expo >> 8;
 		Expodoit[5] = expo;
-		i2c_w8(gspca_dev->dev, Expodoit);
+		i2c_w8(gspca_dev, Expodoit);
 		break;
 	    }
 	case SENSOR_MI0360: {
@@ -1086,9 +1077,9 @@
 			expo = 0x0001;
 		expoMi[3] = expo >> 8;
 		expoMi[4] = expo;
-		i2c_w8(gspca_dev->dev, expoMi);
-		i2c_w8(gspca_dev->dev, doit);
-		i2c_w8(gspca_dev->dev, sensorgo);
+		i2c_w8(gspca_dev, expoMi);
+		i2c_w8(gspca_dev, doit);
+		i2c_w8(gspca_dev, sensorgo);
 		break;
 	    }
 	case SENSOR_MO4000: {
@@ -1102,11 +1093,11 @@
 		else if (expo < 0x0001)
 			expo = 0x0001;
 		expoMof[3] = (expo & 0x03fc) >> 2;
-		i2c_w8(gspca_dev->dev, expoMof);
+		i2c_w8(gspca_dev, expoMof);
 		expoMo10[3] = ((expo & 0x1c00) >> 10)
 				| ((expo & 0x0003) << 4);
-		i2c_w8(gspca_dev->dev, expoMo10);
-		i2c_w8(gspca_dev->dev, gainMo);
+		i2c_w8(gspca_dev, expoMo10);
+		i2c_w8(gspca_dev, gainMo);
 		PDEBUG(D_CONF, "set exposure %d",
 			((expoMo10[3] & 0x07) << 10)
 			| (expoMof[3] << 2)
@@ -1145,7 +1136,7 @@
 	}
 
 	k2 = sd->brightness >> 10;
-	reg_w(gspca_dev->dev, 0x96, &k2, 1);
+	reg_w(gspca_dev, 0x96, &k2, 1);
 }
 
 static void setcontrast(struct gspca_dev *gspca_dev)
@@ -1160,7 +1151,7 @@
 	contrast[2] = k2;
 	contrast[0] = (k2 + 1) >> 1;
 	contrast[4] = (k2 + 1) / 5;
-	reg_w(gspca_dev->dev, 0x84, contrast, 6);
+	reg_w(gspca_dev, 0x84, contrast, 6);
 }
 
 static void setcolors(struct gspca_dev *gspca_dev)
@@ -1174,14 +1165,13 @@
 		data = (colour + 32) & 0x7f;	/* blue */
 	else
 		data = (-colour + 32) & 0x7f;	/* red */
-	reg_w(gspca_dev->dev, 0x05, &data, 1);
+	reg_w(gspca_dev, 0x05, &data, 1);
 }
 
 /* -- start the camera -- */
 static void sd_start(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	int i;
 	__u8 data;
 	__u8 reg1;
@@ -1203,45 +1193,45 @@
 /*fixme:jfm this sequence should appear at end of sd_start */
 /* with
 	data = 0x44;
-	reg_w(dev, 0x01, &data, 1); */
-	reg_w(dev, 0x15, &sn9c1xx[0x15], 1);
-	reg_w(dev, 0x16, &sn9c1xx[0x16], 1);
-	reg_w(dev, 0x12, &sn9c1xx[0x12], 1);
-	reg_w(dev, 0x13, &sn9c1xx[0x13], 1);
-	reg_w(dev, 0x18, &sn9c1xx[0x18], 1);
-	reg_w(dev, 0xd2, &DC29[0], 1);
-	reg_w(dev, 0xd3, &DC29[1], 1);
-	reg_w(dev, 0xc6, &DC29[2], 1);
-	reg_w(dev, 0xc7, &DC29[3], 1);
-	reg_w(dev, 0xc8, &DC29[4], 1);
-	reg_w(dev, 0xc9, &DC29[5], 1);
+	reg_w(gspca_dev, 0x01, &data, 1); */
+	reg_w(gspca_dev, 0x15, &sn9c1xx[0x15], 1);
+	reg_w(gspca_dev, 0x16, &sn9c1xx[0x16], 1);
+	reg_w(gspca_dev, 0x12, &sn9c1xx[0x12], 1);
+	reg_w(gspca_dev, 0x13, &sn9c1xx[0x13], 1);
+	reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1);
+	reg_w(gspca_dev, 0xd2, &DC29[0], 1);
+	reg_w(gspca_dev, 0xd3, &DC29[1], 1);
+	reg_w(gspca_dev, 0xc6, &DC29[2], 1);
+	reg_w(gspca_dev, 0xc7, &DC29[3], 1);
+	reg_w(gspca_dev, 0xc8, &DC29[4], 1);
+	reg_w(gspca_dev, 0xc9, &DC29[5], 1);
 /*fixme:jfm end of ending sequence */
-	reg_w(dev, 0x18, &sn9c1xx[0x18], 1);
+	reg_w(gspca_dev, 0x18, &sn9c1xx[0x18], 1);
 	if (sd->customid == SN9C325)
 		data = 0xae;
 	else
 		data = 0x60;
-	reg_w(dev, 0x17, &data, 1);
-	reg_w(dev, 0x05, &sn9c1xx[5], 1);
-	reg_w(dev, 0x07, &sn9c1xx[7], 1);
-	reg_w(dev, 0x06, &sn9c1xx[6], 1);
-	reg_w(dev, 0x14, &sn9c1xx[0x14], 1);
+	reg_w(gspca_dev, 0x17, &data, 1);
+	reg_w(gspca_dev, 0x05, &sn9c1xx[5], 1);
+	reg_w(gspca_dev, 0x07, &sn9c1xx[7], 1);
+	reg_w(gspca_dev, 0x06, &sn9c1xx[6], 1);
+	reg_w(gspca_dev, 0x14, &sn9c1xx[0x14], 1);
 	if (sd->customid == SN9C325) {
-		reg_w(dev, 0x20, regsn20_sn9c325, 0x11);
+		reg_w(gspca_dev, 0x20, regsn20_sn9c325, 0x11);
 		for (i = 0; i < 8; i++)
-			reg_w(dev, 0x84, reg84_sn9c325, 0x15);
+			reg_w(gspca_dev, 0x84, reg84_sn9c325, 0x15);
 		data = 0x0a;
-		reg_w(dev, 0x9a, &data, 1);
+		reg_w(gspca_dev, 0x9a, &data, 1);
 		data = 0x60;
-		reg_w(dev, 0x99, &data, 1);
+		reg_w(gspca_dev, 0x99, &data, 1);
 	} else {
-		reg_w(dev, 0x20, regsn20, 0x11);
+		reg_w(gspca_dev, 0x20, regsn20, 0x11);
 		for (i = 0; i < 8; i++)
-			reg_w(dev, 0x84, reg84, 0x15);
+			reg_w(gspca_dev, 0x84, reg84, 0x15);
 		data = 0x08;
-		reg_w(dev, 0x9a, &data, 1);
+		reg_w(gspca_dev, 0x9a, &data, 1);
 		data = 0x59;
-		reg_w(dev, 0x99, &data, 1);
+		reg_w(gspca_dev, 0x99, &data, 1);
 	}
 
 	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
@@ -1294,38 +1284,38 @@
 		}
 		break;
 	}
-	reg_w(dev, 0xc0, C0, 6);
+	reg_w(gspca_dev, 0xc0, C0, 6);
 	switch (sd->customid) {
 	case SN9C120:			/*jfm ?? */
-		reg_w(dev, 0xca, CA_sn9c120, 4);
+		reg_w(gspca_dev, 0xca, CA_sn9c120, 4);
 		break;
 	default:
-		reg_w(dev, 0xca, CA, 4);
+		reg_w(gspca_dev, 0xca, CA, 4);
 		break;
 	}
 	switch (sd->customid) {
 	case SN9C120:			/*jfm ?? */
 	case SN9C325:
-		reg_w(dev, 0xce, CE_sn9c325, 4);
+		reg_w(gspca_dev, 0xce, CE_sn9c325, 4);
 		break;
 	default:
-		reg_w(dev, 0xce, CE, 4);
+		reg_w(gspca_dev, 0xce, CE, 4);
 					/* ?? {0x1e, 0xdd, 0x2d, 0xe7} */
 		break;
 	}
 
 	/* here change size mode 0 -> VGA; 1 -> CIF */
 	data = 0x40 | sn9c1xx[0x18] | (mode << 4);
-	reg_w(dev, 0x18, &data, 1);
+	reg_w(gspca_dev, 0x18, &data, 1);
 
-	reg_w(dev, 0x100, qtable4, 0x40);
-	reg_w(dev, 0x140, qtable4 + 0x40, 0x40);
+	reg_w(gspca_dev, 0x100, qtable4, 0x40);
+	reg_w(gspca_dev, 0x140, qtable4 + 0x40, 0x40);
 
 	data = sn9c1xx[0x18] | (mode << 4);
-	reg_w(dev, 0x18, &data, 1);
+	reg_w(gspca_dev, 0x18, &data, 1);
 
-	reg_w(dev, 0x17, &reg17, 1);
-	reg_w(dev, 0x01, &reg1, 1);
+	reg_w(gspca_dev, 0x17, &reg17, 1);
+	reg_w(gspca_dev, 0x01, &reg1, 1);
 	setbrightness(gspca_dev);
 	setcontrast(gspca_dev);
 }
@@ -1333,7 +1323,6 @@
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	static const __u8 stophv7131[] =
 		{ 0xa1, 0x11, 0x02, 0x09, 0x00, 0x00, 0x00, 0x10 };
 	static const __u8 stopmi0360[] =
@@ -1345,11 +1334,11 @@
 	data = 0x0b;
 	switch (sd->sensor) {
 	case SENSOR_HV7131R:
-		i2c_w8(dev, stophv7131);
+		i2c_w8(gspca_dev, stophv7131);
 		data = 0x2b;
 		break;
 	case SENSOR_MI0360:
-		i2c_w8(dev, stopmi0360);
+		i2c_w8(gspca_dev, stopmi0360);
 		data = 0x29;
 		break;
 	case SENSOR_MO4000:
@@ -1362,12 +1351,12 @@
 		break;
 	}
 	sn9c1xx = sn_tb[(int) sd->sensor];
-	reg_w(dev, 0x01, &sn9c1xx[1], 1);
-	reg_w(dev, 0x17, &sn9c1xx[0x17], 1);
-	reg_w(dev, 0x01, &sn9c1xx[1], 1);
-	reg_w(dev, 0x01, &data, 1);
+	reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1);
+	reg_w(gspca_dev, 0x17, &sn9c1xx[0x17], 1);
+	reg_w(gspca_dev, 0x01, &sn9c1xx[1], 1);
+	reg_w(gspca_dev, 0x01, &data, 1);
 	regF1 = 0x01;
-	reg_w(dev, 0xf1, &regF1, 1);
+	reg_w(gspca_dev, 0xf1, &regF1, 1);
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
@@ -1463,33 +1452,35 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	__u8 hexpo, mexpo, lexpo;
-	__u8 expo[6];
 
 	switch (sd->sensor) {
 	case SENSOR_HV7131R:
 		/* read sensor exposure */
-		i2c_r5(gspca_dev, 0x25, expo);
-		return (expo[0] << 16) | (expo[1] << 8) | expo[2];
+		i2c_r5(gspca_dev, 0x25);
+		return (gspca_dev->usb_buf[0] << 16)
+			| (gspca_dev->usb_buf[1] << 8)
+			| gspca_dev->usb_buf[2];
 	case SENSOR_MI0360:
 		/* read sensor exposure */
-		i2c_r5(gspca_dev, 0x09, expo);
-		return (expo[0] << 8) | expo[1];
+		i2c_r5(gspca_dev, 0x09);
+		return (gspca_dev->usb_buf[0] << 8)
+			| gspca_dev->usb_buf[1];
 	case SENSOR_MO4000:
-		i2c_r5(gspca_dev, 0x0e, expo);
-		hexpo = 0;		/* expo[1] & 0x07; */
-		mexpo = 0x40;		/* expo[2] &0xff; */
-		lexpo = (expo[1] & 0x30) >> 4;
+		i2c_r5(gspca_dev, 0x0e);
+		hexpo = 0;		/* gspca_dev->usb_buf[1] & 0x07; */
+		mexpo = 0x40;		/* gspca_dev->usb_buf[2] & 0xff; */
+		lexpo = (gspca_dev->usb_buf[1] & 0x30) >> 4;
 		PDEBUG(D_CONF, "exposure %d",
 			(hexpo << 10) | (mexpo << 2) | lexpo);
 		return (hexpo << 10) | (mexpo << 2) | lexpo;
 	default:
 /*	case SENSOR_OV7660: */
 		/* read sensor exposure */
-		i2c_r5(gspca_dev, 0x04, expo);
-		hexpo = expo[3] & 0x2f;
-		lexpo = expo[0] & 0x02;
-		i2c_r5(gspca_dev, 0x08, expo);
-		mexpo = expo[2];
+		i2c_r5(gspca_dev, 0x04);
+		hexpo = gspca_dev->usb_buf[3] & 0x2f;
+		lexpo = gspca_dev->usb_buf[0] & 0x02;
+		i2c_r5(gspca_dev, 0x08);
+		mexpo = gspca_dev->usb_buf[2];
 		return (hexpo << 10) | (mexpo << 2) | lexpo;
 	}
 }
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c
index d00f0f7..1562061 100644
--- a/drivers/media/video/gspca/spca500.c
+++ b/drivers/media/video/gspca/spca500.c
@@ -24,8 +24,8 @@
 #include "gspca.h"
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA500 USB Camera Driver");
@@ -372,26 +372,27 @@
 	 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28}
 };
 
-static void reg_r(struct usb_device *dev,
-			   __u16 index,
-			   __u8 *buffer, __u16 length)
+/* read 'len' bytes to gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 index,
+		  __u16 length)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
-			index, buffer, length, 500);
+			index, gspca_dev->usb_buf, length, 500);
 }
 
-static int reg_w(struct usb_device *dev,
+static int reg_w(struct gspca_dev *gspca_dev,
 		     __u16 req, __u16 index, __u16 value)
 {
 	int ret;
 
 	PDEBUG(D_USBO, "reg write: [0x%02x] = 0x%02x", index, value);
-	ret = usb_control_msg(dev,
-			usb_sndctrlpipe(dev, 0),
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			value, index, NULL, 0, 500);
@@ -401,28 +402,27 @@
 }
 
 /* returns: negative is error, pos or zero is data */
-static int reg_r_12(struct usb_device *dev,
+static int reg_r_12(struct gspca_dev *gspca_dev,
 			__u16 req,	/* bRequest */
 			__u16 index,	/* wIndex */
 			__u16 length)	/* wLength (1 or 2 only) */
 {
 	int ret;
-	__u8 buf[2];
 
-	buf[1] = 0;
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	gspca_dev->usb_buf[1] = 0;
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
 			index,
-			buf, length,
+			gspca_dev->usb_buf, length,
 			500);		/* timeout */
 	if (ret < 0) {
 		PDEBUG(D_ERR, "reg_r_12 err %d", ret);
 		return -1;
 	}
-	return (buf[1] << 8) + buf[0];
+	return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
 }
 
 /*
@@ -430,13 +430,13 @@
  * a reg_read call.
  * Returns: negative is error or timeout, zero is success.
  */
-static int reg_r_wait(struct usb_device *dev,
+static int reg_r_wait(struct gspca_dev *gspca_dev,
 			__u16 reg, __u16 index, __u16 value)
 {
 	int ret, cnt = 20;
 
 	while (--cnt > 0) {
-		ret = reg_r_12(dev, reg, index, 1);
+		ret = reg_r_12(gspca_dev, reg, index, 1);
 		if (ret == value)
 			return 0;
 		msleep(50);
@@ -447,11 +447,10 @@
 static int write_vector(struct gspca_dev *gspca_dev,
 			const __u16 data[][3])
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int ret, i = 0;
 
 	while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
-		ret = reg_w(dev, data[i][0], data[i][2], data[i][1]);
+		ret = reg_w(gspca_dev, data[i][0], data[i][2], data[i][1]);
 		if (ret < 0)
 			return ret;
 		i++;
@@ -465,19 +464,18 @@
 				unsigned int cbase,
 				const __u8 qtable[2][64])
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int i, err;
 
 	/* loop over y components */
 	for (i = 0; i < 64; i++) {
-		err = reg_w(dev, request, ybase + i, qtable[0][i]);
+		err = reg_w(gspca_dev, request, ybase + i, qtable[0][i]);
 		if (err < 0)
 			return err;
 	}
 
 	/* loop over c components */
 	for (i = 0; i < 64; i++) {
-		err = reg_w(dev, request, cbase + i, qtable[1][i]);
+		err = reg_w(gspca_dev, request, cbase + i, qtable[1][i]);
 		if (err < 0)
 			return err;
 	}
@@ -486,37 +484,33 @@
 
 static void spca500_ping310(struct gspca_dev *gspca_dev)
 {
-	__u8 Data[2];
-
-	reg_r(gspca_dev->dev, 0x0d04, Data, 2);
+	reg_r(gspca_dev, 0x0d04, 2);
 	PDEBUG(D_STREAM, "ClickSmart310 ping 0x0d04 0x%02x 0x%02x",
-		Data[0], Data[1]);
+		gspca_dev->usb_buf[0], gspca_dev->usb_buf[1]);
 }
 
 static void spca500_clksmart310_init(struct gspca_dev *gspca_dev)
 {
-	__u8 Data[2];
-
-	reg_r(gspca_dev->dev, 0x0d05, Data, 2);
+	reg_r(gspca_dev, 0x0d05, 2);
 	PDEBUG(D_STREAM, "ClickSmart310 init 0x0d05 0x%02x 0x%02x",
-		Data[0], Data[1]);
-	reg_w(gspca_dev->dev, 0x00, 0x8167, 0x5a);
+		gspca_dev->usb_buf[0], gspca_dev->usb_buf[1]);
+	reg_w(gspca_dev, 0x00, 0x8167, 0x5a);
 	spca500_ping310(gspca_dev);
 
-	reg_w(gspca_dev->dev, 0x00, 0x8168, 0x22);
-	reg_w(gspca_dev->dev, 0x00, 0x816a, 0xc0);
-	reg_w(gspca_dev->dev, 0x00, 0x816b, 0x0b);
-	reg_w(gspca_dev->dev, 0x00, 0x8169, 0x25);
-	reg_w(gspca_dev->dev, 0x00, 0x8157, 0x5b);
-	reg_w(gspca_dev->dev, 0x00, 0x8158, 0x5b);
-	reg_w(gspca_dev->dev, 0x00, 0x813f, 0x03);
-	reg_w(gspca_dev->dev, 0x00, 0x8151, 0x4a);
-	reg_w(gspca_dev->dev, 0x00, 0x8153, 0x78);
-	reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x04);
+	reg_w(gspca_dev, 0x00, 0x8168, 0x22);
+	reg_w(gspca_dev, 0x00, 0x816a, 0xc0);
+	reg_w(gspca_dev, 0x00, 0x816b, 0x0b);
+	reg_w(gspca_dev, 0x00, 0x8169, 0x25);
+	reg_w(gspca_dev, 0x00, 0x8157, 0x5b);
+	reg_w(gspca_dev, 0x00, 0x8158, 0x5b);
+	reg_w(gspca_dev, 0x00, 0x813f, 0x03);
+	reg_w(gspca_dev, 0x00, 0x8151, 0x4a);
+	reg_w(gspca_dev, 0x00, 0x8153, 0x78);
+	reg_w(gspca_dev, 0x00, 0x0d01, 0x04);
 						/* 00 for adjust shutter */
-	reg_w(gspca_dev->dev, 0x00, 0x0d02, 0x01);
-	reg_w(gspca_dev->dev, 0x00, 0x8169, 0x25);
-	reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x02);
+	reg_w(gspca_dev, 0x00, 0x0d02, 0x01);
+	reg_w(gspca_dev, 0x00, 0x8169, 0x25);
+	reg_w(gspca_dev, 0x00, 0x0d01, 0x02);
 }
 
 static void spca500_setmode(struct gspca_dev *gspca_dev,
@@ -525,14 +519,14 @@
 	int mode;
 
 	/* set x multiplier */
-	reg_w(gspca_dev->dev, 0, 0x8001, xmult);
+	reg_w(gspca_dev, 0, 0x8001, xmult);
 
 	/* set y multiplier */
-	reg_w(gspca_dev->dev, 0, 0x8002, ymult);
+	reg_w(gspca_dev, 0, 0x8002, ymult);
 
 	/* use compressed mode, VGA, with mode specific subsample */
 	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
-	reg_w(gspca_dev->dev, 0, 0x8003, mode << 4);
+	reg_w(gspca_dev, 0, 0x8003, mode << 4);
 }
 
 static int spca500_full_reset(struct gspca_dev *gspca_dev)
@@ -540,18 +534,18 @@
 	int err;
 
 	/* send the reset command */
-	err = reg_w(gspca_dev->dev, 0xe0, 0x0001, 0x0000);
+	err = reg_w(gspca_dev, 0xe0, 0x0001, 0x0000);
 	if (err < 0)
 		return err;
 
 	/* wait for the reset to complete */
-	err = reg_r_wait(gspca_dev->dev, 0x06, 0x0000, 0x0000);
+	err = reg_r_wait(gspca_dev, 0x06, 0x0000, 0x0000);
 	if (err < 0)
 		return err;
-	err = reg_w(gspca_dev->dev, 0xe0, 0x0000, 0x0000);
+	err = reg_w(gspca_dev, 0xe0, 0x0000, 0x0000);
 	if (err < 0)
 		return err;
-	err = reg_r_wait(gspca_dev->dev, 0x06, 0, 0);
+	err = reg_r_wait(gspca_dev, 0x06, 0, 0);
 	if (err < 0) {
 		PDEBUG(D_ERR, "reg_r_wait() failed");
 		return err;
@@ -568,15 +562,13 @@
 /* up-port the same feature as in 2.4.x kernel */
 static int spca500_synch310(struct gspca_dev *gspca_dev)
 {
-	__u8 Data;
-
 	if (usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0) < 0) {
 		PDEBUG(D_ERR, "Set packet size: set interface error");
 		goto error;
 	}
 	spca500_ping310(gspca_dev);
 
-	reg_r(gspca_dev->dev, 0x0d00, &Data, 1);
+	reg_r(gspca_dev, 0x0d00, 1);
 
 	/* need alt setting here */
 	PDEBUG(D_PACK, "ClickSmart310 sync alt: %d", gspca_dev->alt);
@@ -600,12 +592,12 @@
 
 	/* some unknow command from Aiptek pocket dv and family300 */
 
-	reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x01);
-	reg_w(gspca_dev->dev, 0x00, 0x0d03, 0x00);
-	reg_w(gspca_dev->dev, 0x00, 0x0d02, 0x01);
+	reg_w(gspca_dev, 0x00, 0x0d01, 0x01);
+	reg_w(gspca_dev, 0x00, 0x0d03, 0x00);
+	reg_w(gspca_dev, 0x00, 0x0d02, 0x01);
 
 	/* enable drop packet */
-	reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
+	reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
 
 	err = spca50x_setup_qtable(gspca_dev, 0x00, 0x8800, 0x8840,
 				 qtable_pocketdv);
@@ -613,22 +605,23 @@
 		PDEBUG(D_ERR|D_STREAM, "spca50x_setup_qtable failed on init");
 
 	/* set qtable index */
-	reg_w(gspca_dev->dev, 0x00, 0x8880, 2);
+	reg_w(gspca_dev, 0x00, 0x8880, 2);
 	/* family cam Quicksmart stuff */
-	reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00);
+	reg_w(gspca_dev, 0x00, 0x800a, 0x00);
 	/* Set agc transfer: synced inbetween frames */
-	reg_w(gspca_dev->dev, 0x00, 0x820f, 0x01);
+	reg_w(gspca_dev, 0x00, 0x820f, 0x01);
 	/* Init SDRAM - needed for SDRAM access */
-	reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04);
+	reg_w(gspca_dev, 0x00, 0x870a, 0x04);
 	/*Start init sequence or stream */
-
-	reg_w(gspca_dev->dev, 0, 0x8003, 0x00);
+	reg_w(gspca_dev, 0, 0x8003, 0x00);
 	/* switch to video camera mode */
-	reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+	reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 	msleep(2000);
-	if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0)
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-	reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+	if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0) {
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
+	}
 }
 
 /* this function is called at probe time */
@@ -785,9 +778,10 @@
 	}
 
 	/* is there a sensor here ? */
-	reg_r(gspca_dev->dev, 0x8a04, &Data, 1);
-	PDEBUG(D_STREAM, "Spca500 Sensor Address 0x%02X", Data);
-	PDEBUG(D_STREAM, "Spca500 curr_mode: %d Xmult: 0x%02X, Ymult: 0x%02X",
+	reg_r(gspca_dev, 0x8a04, 1);
+	PDEBUG(D_STREAM, "Spca500 Sensor Address 0x%02x",
+		gspca_dev->usb_buf[0]);
+	PDEBUG(D_STREAM, "Spca500 curr_mode: %d Xmult: 0x%02x, Ymult: 0x%02x",
 		gspca_dev->curr_mode, xmult, ymult);
 
 	/* setup qtable */
@@ -796,33 +790,34 @@
 		 spca500_setmode(gspca_dev, xmult, ymult);
 
 		/* enable drop packet */
-		reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 3);
+		reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
+		reg_w(gspca_dev, 0x00, 0x8880, 3);
 		err = spca50x_setup_qtable(gspca_dev,
 					   0x00, 0x8800, 0x8840,
 					   qtable_creative_pccam);
 		if (err < 0)
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
 		/* Init SDRAM - needed for SDRAM access */
-		reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04);
+		reg_w(gspca_dev, 0x00, 0x870a, 0x04);
 
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 		msleep(500);
-		if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0)
+		if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
 			PDEBUG(D_ERR, "reg_r_wait() failed");
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 
 		spca500_synch310(gspca_dev);
 
 		write_vector(gspca_dev, spca500_visual_defaults);
 		spca500_setmode(gspca_dev, xmult, ymult);
 		/* enable drop packet */
-		reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
+		reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
 			PDEBUG(D_ERR, "failed to enable drop packet");
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 3);
+		reg_w(gspca_dev, 0x00, 0x8880, 3);
 		err = spca50x_setup_qtable(gspca_dev,
 					   0x00, 0x8800, 0x8840,
 					   qtable_creative_pccam);
@@ -830,16 +825,17 @@
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
 
 		/* Init SDRAM - needed for SDRAM access */
-		reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04);
+		reg_w(gspca_dev, 0x00, 0x870a, 0x04);
 
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 
-		if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0)
+		if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
 			PDEBUG(D_ERR, "reg_r_wait() failed");
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 		break;
 	case CreativePCCam300:		/* Creative PC-CAM 300 640x480 CCD */
 	case IntelPocketPCCamera:	/* FIXME: Temporary fix for
@@ -852,10 +848,10 @@
 			PDEBUG(D_ERR, "spca500_full_reset failed");
 
 		/* enable drop packet */
-		err = reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
+		err = reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
 		if (err < 0)
 			PDEBUG(D_ERR, "failed to enable drop packet");
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 3);
+		reg_w(gspca_dev, 0x00, 0x8880, 3);
 		err = spca50x_setup_qtable(gspca_dev,
 					   0x00, 0x8800, 0x8840,
 					   qtable_creative_pccam);
@@ -863,16 +859,17 @@
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
 
 		spca500_setmode(gspca_dev, xmult, ymult);
-		reg_w(gspca_dev->dev, 0x20, 0x0001, 0x0004);
+		reg_w(gspca_dev, 0x20, 0x0001, 0x0004);
 
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 
-		if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0)
+		if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
 			PDEBUG(D_ERR, "reg_r_wait() failed");
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 
 /*		write_vector(gspca_dev, spca500_visual_defaults); */
 		break;
@@ -883,8 +880,8 @@
 		if (err < 0)
 			PDEBUG(D_ERR, "spca500_full_reset failed");
 		/* enable drop packet */
-		reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 0);
+		reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
+		reg_w(gspca_dev, 0x00, 0x8880, 0);
 		err = spca50x_setup_qtable(gspca_dev,
 					   0x00, 0x8800, 0x8840,
 					   qtable_kodak_ez200);
@@ -892,16 +889,17 @@
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
 		spca500_setmode(gspca_dev, xmult, ymult);
 
-		reg_w(gspca_dev->dev, 0x20, 0x0001, 0x0004);
+		reg_w(gspca_dev, 0x20, 0x0001, 0x0004);
 
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 
-		if (reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44) != 0)
+		if (reg_r_wait(gspca_dev, 0, 0x8000, 0x44) != 0)
 			PDEBUG(D_ERR, "reg_r_wait() failed");
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 
 /*		write_vector(gspca_dev, spca500_visual_defaults); */
 		break;
@@ -916,56 +914,58 @@
 	case ToptroIndus:
 	case AgfaCl20:
 		spca500_reinit(gspca_dev);
-		reg_w(gspca_dev->dev, 0x00, 0x0d01, 0x01);
+		reg_w(gspca_dev, 0x00, 0x0d01, 0x01);
 		/* enable drop packet */
-		reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
+		reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
 
 		err = spca50x_setup_qtable(gspca_dev,
 				   0x00, 0x8800, 0x8840, qtable_pocketdv);
 		if (err < 0)
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 2);
+		reg_w(gspca_dev, 0x00, 0x8880, 2);
 
 		/* familycam Quicksmart pocketDV stuff */
-		reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00);
+		reg_w(gspca_dev, 0x00, 0x800a, 0x00);
 		/* Set agc transfer: synced inbetween frames */
-		reg_w(gspca_dev->dev, 0x00, 0x820f, 0x01);
+		reg_w(gspca_dev, 0x00, 0x820f, 0x01);
 		/* Init SDRAM - needed for SDRAM access */
-		reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04);
+		reg_w(gspca_dev, 0x00, 0x870a, 0x04);
 
 		spca500_setmode(gspca_dev, xmult, ymult);
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
 
-		reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44);
+		reg_r_wait(gspca_dev, 0, 0x8000, 0x44);
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 		break;
 	case LogitechTraveler:
 	case LogitechClickSmart510:
-		reg_w(gspca_dev->dev, 0x02, 0x00, 0x00);
+		reg_w(gspca_dev, 0x02, 0x00, 0x00);
 		/* enable drop packet */
-		reg_w(gspca_dev->dev, 0x00, 0x850a, 0x0001);
+		reg_w(gspca_dev, 0x00, 0x850a, 0x0001);
 
 		err = spca50x_setup_qtable(gspca_dev,
 					0x00, 0x8800,
 					0x8840, qtable_creative_pccam);
 		if (err < 0)
 			PDEBUG(D_ERR, "spca50x_setup_qtable failed");
-		reg_w(gspca_dev->dev, 0x00, 0x8880, 3);
-		reg_w(gspca_dev->dev, 0x00, 0x800a, 0x00);
+		reg_w(gspca_dev, 0x00, 0x8880, 3);
+		reg_w(gspca_dev, 0x00, 0x800a, 0x00);
 		/* Init SDRAM - needed for SDRAM access */
-		reg_w(gspca_dev->dev, 0x00, 0x870a, 0x04);
+		reg_w(gspca_dev, 0x00, 0x870a, 0x04);
 
 		spca500_setmode(gspca_dev, xmult, ymult);
 
 		/* switch to video camera mode */
-		reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
-		reg_r_wait(gspca_dev->dev, 0, 0x8000, 0x44);
+		reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
+		reg_r_wait(gspca_dev, 0, 0x8000, 0x44);
 
-		reg_r(gspca_dev->dev, 0x816b, &Data, 1);
-		reg_w(gspca_dev->dev, 0x00, 0x816b, Data);
+		reg_r(gspca_dev, 0x816b, 1);
+		Data = gspca_dev->usb_buf[0];
+		reg_w(gspca_dev, 0x00, 0x816b, Data);
 		write_vector(gspca_dev, Clicksmart510_defaults);
 		break;
 	}
@@ -973,14 +973,13 @@
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
-	__u8 data;
-
-	reg_w(gspca_dev->dev, 0, 0x8003, 0x00);
+	reg_w(gspca_dev, 0, 0x8003, 0x00);
 
 	/* switch to video camera mode */
-	reg_w(gspca_dev->dev, 0x00, 0x8000, 0x0004);
-	reg_r(gspca_dev->dev, 0x8000, &data, 1);
-	PDEBUG(D_STREAM, "stop SPCA500 done reg8000: 0x%2x", data);
+	reg_w(gspca_dev, 0x00, 0x8000, 0x0004);
+	reg_r(gspca_dev, 0x8000, 1);
+	PDEBUG(D_STREAM, "stop SPCA500 done reg8000: 0x%2x",
+		gspca_dev->usb_buf[0]);
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
@@ -1043,7 +1042,7 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	reg_w(gspca_dev->dev, 0x00, 0x8167,
+	reg_w(gspca_dev, 0x00, 0x8167,
 			(__u8) (sd->brightness - 128));
 }
 
@@ -1052,7 +1051,7 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	int ret;
 
-	ret = reg_r_12(gspca_dev->dev, 0x00, 0x8167, 1);
+	ret = reg_r_12(gspca_dev, 0x00, 0x8167, 1);
 	if (ret >= 0)
 		sd->brightness = ret + 128;
 }
@@ -1061,7 +1060,7 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	reg_w(gspca_dev->dev, 0x00, 0x8168, sd->contrast);
+	reg_w(gspca_dev, 0x00, 0x8168, sd->contrast);
 }
 
 static void getcontrast(struct gspca_dev *gspca_dev)
@@ -1069,7 +1068,7 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	int ret;
 
-	ret = reg_r_12(gspca_dev->dev, 0x0, 0x8168, 1);
+	ret = reg_r_12(gspca_dev, 0x0, 0x8168, 1);
 	if (ret >= 0)
 		sd->contrast = ret;
 }
@@ -1078,7 +1077,7 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	reg_w(gspca_dev->dev, 0x00, 0x8169, sd->colors);
+	reg_w(gspca_dev, 0x00, 0x8169, sd->colors);
 }
 
 static void getcolors(struct gspca_dev *gspca_dev)
@@ -1086,7 +1085,7 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	int ret;
 
-	ret = reg_r_12(gspca_dev->dev, 0x0, 0x8169, 1);
+	ret = reg_r_12(gspca_dev, 0x0, 0x8169, 1);
 	if (ret >= 0)
 		sd->colors = ret;
 }
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c
index 2064dc0..8cee674 100644
--- a/drivers/media/video/gspca/spca501.c
+++ b/drivers/media/video/gspca/spca501.c
@@ -23,8 +23,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA501 USB Camera Driver");
@@ -1826,28 +1826,27 @@
 }
 
 /* returns: negative is error, pos or zero is data */
-static int reg_read(struct usb_device *dev,
+static int reg_read(struct gspca_dev *gspca_dev,
 			__u16 req,	/* bRequest */
 			__u16 index,	/* wIndex */
 			__u16 length)	/* wLength (1 or 2 only) */
 {
 	int ret;
-	__u8 buf[2];
 
-	buf[1] = 0;
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	gspca_dev->usb_buf[1] = 0;
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
 			index,
-			buf, length,
+			gspca_dev->usb_buf, length,
 			500);			/* timeout */
 	if (ret < 0) {
 		PDEBUG(D_ERR, "reg_read err %d", ret);
 		return -1;
 	}
-	return (buf[1] << 8) + buf[0];
+	return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
 }
 
 static int write_vector(struct gspca_dev *gspca_dev,
@@ -1883,7 +1882,7 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	__u16 brightness;
 
-	brightness = reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x11, 2);
+	brightness = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x11, 2);
 	sd->brightness = brightness << 1;
 }
 
@@ -1913,8 +1912,8 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	sd->colors = reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x0c, 2);
-/*	sd->hue = (reg_read(gspca_dev->dev, SPCA501_REG_CCDSP, 0x13, */
+	sd->colors = reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x0c, 2);
+/*	sd->hue = (reg_read(gspca_dev, SPCA501_REG_CCDSP, 0x13, */
 /*			2) & 0xFF) << 8; */
 }
 
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c
index 5d28d23..ddea6e1 100644
--- a/drivers/media/video/gspca/spca505.c
+++ b/drivers/media/video/gspca/spca505.c
@@ -23,8 +23,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA505 USB Camera Driver");
@@ -593,29 +593,27 @@
 }
 
 /* returns: negative is error, pos or zero is data */
-static int reg_read(struct usb_device *dev,
+static int reg_read(struct gspca_dev *gspca_dev,
 			__u16 reg,	/* bRequest */
 			__u16 index,	/* wIndex */
 			__u16 length)	/* wLength (1 or 2 only) */
 {
 	int ret;
-	__u8 buf[4];
 
-	buf[1] = 0;
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	gspca_dev->usb_buf[1] = 0;
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			reg,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			(__u16) 0,		/* value */
 			(__u16) index,
-			buf,
-			length,
+			gspca_dev->usb_buf, length,
 			500);			/* timeout */
 	if (ret < 0) {
 		PDEBUG(D_ERR, "reg_read err %d", ret);
 		return -1;
 	}
-	return (buf[1] << 8) + buf[0];
+	return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
 }
 
 static int write_vector(struct gspca_dev *gspca_dev,
@@ -697,7 +695,7 @@
 		write_vector(gspca_dev, spca505b_open_data_ccd);
 	else
 		write_vector(gspca_dev, spca505_open_data_ccd);
-	ret = reg_read(gspca_dev->dev, 6, 0x16, 2);
+	ret = reg_read(gspca_dev, 6, 0x16, 2);
 
 	if (ret < 0) {
 		PDEBUG(D_ERR|D_STREAM,
@@ -874,8 +872,8 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 
 	sd->brightness = 255
-		- ((reg_read(gspca_dev->dev, 5, 0x01, 1) >> 2)
-			+ (reg_read(gspca_dev->dev, 5, 0x0, 1) << 6));
+		- ((reg_read(gspca_dev, 5, 0x01, 1) >> 2)
+			+ (reg_read(gspca_dev, 5, 0x0, 1) << 6));
 }
 
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c
index 2d249b0..143203c 100644
--- a/drivers/media/video/gspca/spca506.c
+++ b/drivers/media/video/gspca/spca506.c
@@ -25,8 +25,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA506 USB Camera Driver");
@@ -153,17 +153,18 @@
 #define SAA7113_hue 0x0d	/* defaults 0x00 */
 #define SAA7113_I2C_BASE_WRITE 0x4a
 
-static void reg_r(struct usb_device *dev,
+/* read 'len' bytes to gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
 		  __u16 req,
 		  __u16 index,
-		  __u8 *buffer, __u16 length)
+		  __u16 length)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
-			index, buffer, length,
+			index, gspca_dev->usb_buf, length,
 			500);
 }
 
@@ -189,13 +190,12 @@
 			     __u16 reg)
 {
 	int retry = 60;
-	__u8 Data[2];
 
 	reg_w(gspca_dev->dev, 0x07, reg, 0x0001);
 	reg_w(gspca_dev->dev, 0x07, valeur, 0x0000);
 	while (retry--) {
-		reg_r(gspca_dev->dev, 0x07, 0x0003, Data, 2);
-		if ((Data[0] | Data[1]) == 0x00)
+		reg_r(gspca_dev, 0x07, 0x0003, 2);
+		if ((gspca_dev->usb_buf[0] | gspca_dev->usb_buf[1]) == 0x00)
 			break;
 	}
 }
@@ -203,21 +203,19 @@
 static int spca506_ReadI2c(struct gspca_dev *gspca_dev, __u16 reg)
 {
 	int retry = 60;
-	__u8 Data[2];
-	__u8 value;
 
 	reg_w(gspca_dev->dev, 0x07, SAA7113_I2C_BASE_WRITE, 0x0004);
 	reg_w(gspca_dev->dev, 0x07, reg, 0x0001);
 	reg_w(gspca_dev->dev, 0x07, 0x01, 0x0002);
 	while (--retry) {
-		reg_r(gspca_dev->dev, 0x07, 0x0003, Data, 2);
-		if ((Data[0] | Data[1]) == 0x00)
+		reg_r(gspca_dev, 0x07, 0x0003, 2);
+		if ((gspca_dev->usb_buf[0] | gspca_dev->usb_buf[1]) == 0x00)
 			break;
 	}
 	if (retry == 0)
 		return -1;
-	reg_r(gspca_dev->dev, 0x07, 0x0000, &value, 1);
-	return value;
+	reg_r(gspca_dev, 0x07, 0x0000, 1);
+	return gspca_dev->usb_buf[0];
 }
 
 static void spca506_SetNormeInput(struct gspca_dev *gspca_dev,
@@ -437,7 +435,6 @@
 	struct usb_device *dev = gspca_dev->dev;
 	__u16 norme;
 	__u16 channel;
-	__u8 Data[2];
 
 	/**************************************/
 	reg_w(dev, 0x03, 0x00, 0x0004);
@@ -555,8 +552,8 @@
 	/* compress setting and size */
 	/* set i2c luma */
 	reg_w(dev, 0x02, 0x01, 0x0000);
-	reg_w(dev, 0x03, 0x12, 0x000);
-	reg_r(dev, 0x04, 0x0001, Data, 2);
+	reg_w(dev, 0x03, 0x12, 0x0000);
+	reg_r(gspca_dev, 0x04, 0x0001, 2);
 	PDEBUG(D_STREAM, "webcam started");
 	spca506_GetNormeInput(gspca_dev, &norme, &channel);
 	spca506_SetNormeInput(gspca_dev, norme, channel);
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c
index 7f262f2..d8cd938 100644
--- a/drivers/media/video/gspca/spca508.c
+++ b/drivers/media/video/gspca/spca508.c
@@ -22,8 +22,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA508 USB Camera Driver");
@@ -1433,26 +1433,26 @@
 
 /* read 1 byte */
 /* returns: negative is error, pos or zero is data */
-static int reg_read(struct usb_device *dev,
+static int reg_read(struct gspca_dev *gspca_dev,
 			__u16 index)	/* wIndex */
 {
 	int ret;
-	__u8 data;
 
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,			/* register */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
-			(__u16) 0,		/* value */
+			0,		/* value */
 			index,
-			&data, 1,
+			gspca_dev->usb_buf, 1,
 			500);			/* timeout */
-	PDEBUG(D_USBI, "reg read i:%04x --> %02x", index, data);
+	PDEBUG(D_USBI, "reg read i:%04x --> %02x",
+		index, gspca_dev->usb_buf[0]);
 	if (ret < 0) {
 		PDEBUG(D_ERR|D_USBI, "reg_read err %d", ret);
 		return ret;
 	}
-	return data;
+	return gspca_dev->usb_buf[0];
 }
 
 static int write_vector(struct gspca_dev *gspca_dev,
@@ -1475,15 +1475,12 @@
 			const struct usb_device_id *id)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	struct cam *cam;
-	__u16 vendor;
 	__u16 product;
 	int data1, data2;
 
-	vendor = id->idVendor;
 	product = id->idProduct;
-	switch (vendor) {
+	switch (id->idVendor) {
 	case 0x0130:		/* Clone webcam */
 /*		switch (product) { */
 /*		case 0x0130: */
@@ -1535,15 +1532,15 @@
 	 * prove that we can communicate with the device.  This works, which
 	 * confirms at we are communicating properly and that the device
 	 * is a 508. */
-	data1 = reg_read(dev, 0x8104);
-	data2 = reg_read(dev, 0x8105);
+	data1 = reg_read(gspca_dev, 0x8104);
+	data2 = reg_read(gspca_dev, 0x8105);
 	PDEBUG(D_PROBE, "Webcam Vendor ID: 0x%02x%02x", data2, data1);
 
-	data1 = reg_read(dev, 0x8106);
-	data2 = reg_read(dev, 0x8107);
+	data1 = reg_read(gspca_dev, 0x8106);
+	data2 = reg_read(gspca_dev, 0x8107);
 	PDEBUG(D_PROBE, "Webcam Product ID: 0x%02x%02x", data2, data1);
 
-	data1 = reg_read(dev, 0x8621);
+	data1 = reg_read(gspca_dev, 0x8621);
 	PDEBUG(D_PROBE, "Window 1 average luminance: %d", data1);
 
 	cam = &gspca_dev->cam;
@@ -1711,7 +1708,7 @@
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 
-	sd->brightness = reg_read(gspca_dev->dev, 0x8651);
+	sd->brightness = reg_read(gspca_dev, 0x8651);
 }
 
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c
index f0770ee..b659bd0 100644
--- a/drivers/media/video/gspca/spca561.c
+++ b/drivers/media/video/gspca/spca561.c
@@ -24,8 +24,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA561 USB Camera Driver");
@@ -177,27 +177,28 @@
 	}
 }
 
-static void reg_r(struct usb_device *dev,
-		  __u16 index, __u8 *buffer, __u16 length)
+/* read 'len' bytes to gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 index, __u16 length)
 {
-	usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,			/* request */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,			/* value */
-			index, buffer, length, 500);
+			index, gspca_dev->usb_buf, length, 500);
 }
 
-static void reg_w_buf(struct usb_device *dev,
+static void reg_w_buf(struct gspca_dev *gspca_dev,
 		      __u16 index, const __u8 *buffer, __u16 len)
 {
-	__u8 tmpbuf[8];
-
-	memcpy(tmpbuf, buffer, len);
-	usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+	memcpy(gspca_dev->usb_buf, buffer, len);
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			0,			/* request */
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,			/* value */
-			index, tmpbuf, len, 500);
+			index, gspca_dev->usb_buf, len, 500);
 }
 
 static void i2c_init(struct gspca_dev *gspca_dev, __u8 mode)
@@ -211,7 +212,6 @@
 	int retry = 60;
 	__u8 DataLow;
 	__u8 DataHight;
-	__u8 Data;
 
 	DataLow = valeur;
 	DataHight = valeur >> 8;
@@ -219,8 +219,8 @@
 	reg_w_val(gspca_dev->dev, DataLow, 0x8805);
 	reg_w_val(gspca_dev->dev, DataHight, 0x8800);
 	while (retry--) {
-		reg_r(gspca_dev->dev, 0x8803, &Data, 1);
-		if (!Data)
+		reg_r(gspca_dev, 0x8803, 1);
+		if (!gspca_dev->usb_buf[0])
 			break;
 	}
 }
@@ -230,20 +230,21 @@
 	int retry = 60;
 	__u8 value;
 	__u8 vallsb;
-	__u8 Data;
 
 	reg_w_val(gspca_dev->dev, 0x92, 0x8804);
 	reg_w_val(gspca_dev->dev, reg, 0x8801);
 	reg_w_val(gspca_dev->dev, (mode | 0x01), 0x8802);
 	while (retry--) {
-		reg_r(gspca_dev->dev, 0x8803, &Data, 1);
-		if (!Data)
+		reg_r(gspca_dev, 0x8803, 1);
+		if (!gspca_dev->usb_buf)
 			break;
 	}
 	if (retry == 0)
 		return -1;
-	reg_r(gspca_dev->dev, 0x8800, &value, 1);
-	reg_r(gspca_dev->dev, 0x8805, &vallsb, 1);
+	reg_r(gspca_dev, 0x8800, 1);
+	value = gspca_dev->usb_buf[0];
+	reg_r(gspca_dev, 0x8805, 1);
+	vallsb = gspca_dev->usb_buf[0];
 	return ((int) value << 8) | vallsb;
 }
 
@@ -541,7 +542,7 @@
 	while (sensormap[i][0]) {
 		usbval[0] = sensormap[i][1];
 		usbval[1] = sensormap[i][1] >> 8;
-		reg_w_buf(gspca_dev->dev, sensormap[i][0], usbval, 2);
+		reg_w_buf(gspca_dev, sensormap[i][0], usbval, 2);
 		i++;
 	}
 }
@@ -559,7 +560,6 @@
 		     const struct usb_device_id *id)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	struct cam *cam;
 	__u16 vendor, product;
 	__u8 data1, data2;
@@ -568,11 +568,15 @@
 	 * prove that we can communicate with the device.  This works, which
 	 * confirms at we are communicating properly and that the device
 	 * is a 561. */
-	reg_r(dev, 0x8104, &data1, 1);
-	reg_r(dev, 0x8105, &data2, 1);
+	reg_r(gspca_dev, 0x8104, 1);
+	data1 = gspca_dev->usb_buf[0];
+	reg_r(gspca_dev, 0x8105, 1);
+	data2 = gspca_dev->usb_buf[0];
 	vendor = (data2 << 8) | data1;
-	reg_r(dev, 0x8106, &data1, 1);
-	reg_r(dev, 0x8107, &data2, 1);
+	reg_r(gspca_dev, 0x8106, 1);
+	data1 = gspca_dev->usb_buf[0];
+	reg_r(gspca_dev, 0x8107, 1);
+	data2 = gspca_dev->usb_buf[0];
 	product = (data2 << 8) | data1;
 	if (vendor != id->idVendor || product != id->idProduct) {
 		PDEBUG(D_PROBE, "Bad vendor / product from device");
@@ -656,8 +660,8 @@
 		Reg8391[0] = expotimes & 0xff;	/* exposure */
 		Reg8391[1] = 0x18 | (expotimes >> 8);
 		Reg8391[2] = sd->brightness;	/* gain */
-		reg_w_buf(dev, 0x8391, Reg8391, 8);
-		reg_w_buf(dev, 0x8390, Reg8391, 8);
+		reg_w_buf(gspca_dev, 0x8391, Reg8391, 8);
+		reg_w_buf(gspca_dev, 0x8390, Reg8391, 8);
 		break;
 	    }
 	}
@@ -714,10 +718,11 @@
 			 * is sufficient to push raw frames at ~20fps */
 			reg_w_val(dev, 0x8500, mode);
 		}		/* -- qq@kuku.eu.org */
-		reg_w_buf(dev, 0x8307, Reg8307, 2);
-		reg_w_val(dev, 0x8700, Clck);	/* 0x8f 0x85 0x27 clock */
-		reg_w_val(dev, 0x8112, 0x1e | 0x20);
-		reg_w_val(dev, 0x850b, 0x03);
+		reg_w_buf(gspca_dev, 0x8307, Reg8307, 2);
+		reg_w_val(gspca_dev->dev, 0x8700, Clck);
+						/* 0x8f 0x85 0x27 clock */
+		reg_w_val(gspca_dev->dev, 0x8112, 0x1e | 0x20);
+		reg_w_val(gspca_dev->dev, 0x850b, 0x03);
 		setcontrast(gspca_dev);
 		break;
 	}
@@ -752,10 +757,14 @@
 
 	switch (sd->chip_revision) {
 	case Rev072A:
-		reg_r(gspca_dev->dev, 0x8621, &Gr, 1);
-		reg_r(gspca_dev->dev, 0x8622, &R, 1);
-		reg_r(gspca_dev->dev, 0x8623, &B, 1);
-		reg_r(gspca_dev->dev, 0x8624, &Gb, 1);
+		reg_r(gspca_dev, 0x8621, 1);
+		Gr = gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8622, 1);
+		R = gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8623, 1);
+		B = gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8624, 1);
+		Gb = gspca_dev->usb_buf[0];
 		y = (77 * R + 75 * (Gr + Gb) + 29 * B) >> 8;
 		/* u= (128*B-(43*(Gr+Gb+R))) >> 8; */
 		/* v= (128*R-(53*(Gr+Gb))-21*B) >> 8; */
@@ -867,20 +876,19 @@
 static void getbrightness(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	__u8 value;
 	__u16 tot;
 
 	switch (sd->chip_revision) {
 	case Rev072A:
 		tot = 0;
-		reg_r(gspca_dev->dev, 0x8611, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8612, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8613, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8614, &value, 1);
-		tot += value;
+		reg_r(gspca_dev, 0x8611, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8612, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8613, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8614, 1);
+		tot += gspca_dev->usb_buf[0];
 		sd->brightness = tot >> 2;
 		break;
 	default:
@@ -893,20 +901,19 @@
 static void getcontrast(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	__u8 value;
 	__u16 tot;
 
 	switch (sd->chip_revision) {
 	case Rev072A:
 		tot = 0;
-		reg_r(gspca_dev->dev, 0x8651, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8652, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8653, &value, 1);
-		tot += value;
-		reg_r(gspca_dev->dev, 0x8654, &value, 1);
-		tot += value;
+		reg_r(gspca_dev, 0x8651, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8652, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8653, 1);
+		tot += gspca_dev->usb_buf[0];
+		reg_r(gspca_dev, 0x8654, 1);
+		tot += gspca_dev->usb_buf[0];
 		sd->contrast = tot << 6;
 		break;
 	default:
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c
index d676cd1..c78ee0d 100644
--- a/drivers/media/video/gspca/stk014.c
+++ b/drivers/media/video/gspca/stk014.c
@@ -23,8 +23,8 @@
 #include "gspca.h"
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>");
 MODULE_DESCRIPTION("Syntek DV4000 (STK014) USB Camera Driver");
@@ -127,7 +127,7 @@
 
 /* -- read a register -- */
 static int reg_r(struct gspca_dev *gspca_dev,
-			__u16 index, __u8 *buf)
+			__u16 index)
 {
 	struct usb_device *dev = gspca_dev->dev;
 	int ret;
@@ -137,11 +137,13 @@
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0x00,
 			index,
-			buf, 1,
+			gspca_dev->usb_buf, 1,
 			500);
-	if (ret < 0)
+	if (ret < 0) {
 		PDEBUG(D_ERR, "reg_r err %d", ret);
-	return ret;
+		return ret;
+	}
+	return gspca_dev->usb_buf[0];
 }
 
 /* -- write a register -- */
@@ -164,58 +166,55 @@
 	return ret;
 }
 
-/* -- get a value -- */
+/* -- get a bulk value (4 bytes) -- */
 static int rcv_val(struct gspca_dev *gspca_dev,
-			int ads,
-			int len)
+			int ads)
 {
 	struct usb_device *dev = gspca_dev->dev;
 	int alen, ret;
-	unsigned char bulk_buf[4];
 
 	reg_w(gspca_dev, 0x634, (ads >> 16) & 0xff);
 	reg_w(gspca_dev, 0x635, (ads >> 8) & 0xff);
 	reg_w(gspca_dev, 0x636, ads & 0xff);
 	reg_w(gspca_dev, 0x637, 0);
-	reg_w(gspca_dev, 0x638, len & 0xff);
-	reg_w(gspca_dev, 0x639, len >> 8);
+	reg_w(gspca_dev, 0x638, 4);	/* len & 0xff */
+	reg_w(gspca_dev, 0x639, 0);	/* len >> 8 */
 	reg_w(gspca_dev, 0x63a, 0);
 	reg_w(gspca_dev, 0x63b, 0);
 	reg_w(gspca_dev, 0x630, 5);
-	if (len > sizeof bulk_buf)
-		return -1;
 	ret = usb_bulk_msg(dev,
 			usb_rcvbulkpipe(dev, 5),
-			bulk_buf,
-			len,
+			gspca_dev->usb_buf,
+			4,		/* length */
 			&alen,
-			500);	/* timeout in milliseconds */
+			500);		/* timeout in milliseconds */
 	return ret;
 }
 
-/* -- send a value -- */
+/* -- send a bulk value -- */
 static int snd_val(struct gspca_dev *gspca_dev,
 			int ads,
 			unsigned int val)
 {
 	struct usb_device *dev = gspca_dev->dev;
 	int alen, ret;
-	__u8 value, seq;
-	unsigned char bulk_buf[4];
+	__u8 seq = 0;
 
 	if (ads == 0x003f08) {
-		ret = reg_r(gspca_dev, 0x0704, &value);
+		ret = reg_r(gspca_dev, 0x0704);
 		if (ret < 0)
 			goto ko;
-		ret = reg_r(gspca_dev, 0x0705, &seq);
+		ret = reg_r(gspca_dev, 0x0705);
 		if (ret < 0)
 			goto ko;
-		ret = reg_r(gspca_dev, 0x0650, &value);
+		seq = ret;		/* keep the sequence number */
+		ret = reg_r(gspca_dev, 0x0650);
 		if (ret < 0)
 			goto ko;
 		reg_w(gspca_dev, 0x654, seq);
-	} else
+	} else {
 		reg_w(gspca_dev, 0x654, (ads >> 16) & 0xff);
+	}
 	reg_w(gspca_dev, 0x655, (ads >> 8) & 0xff);
 	reg_w(gspca_dev, 0x656, ads & 0xff);
 	reg_w(gspca_dev, 0x657, 0);
@@ -224,13 +223,13 @@
 	reg_w(gspca_dev, 0x65a, 0);
 	reg_w(gspca_dev, 0x65b, 0);
 	reg_w(gspca_dev, 0x650, 5);
-	bulk_buf[0] = (val >> 24) & 0xff;
-	bulk_buf[1] = (val >> 16) & 0xff;
-	bulk_buf[2] = (val >> 8) & 0xff;
-	bulk_buf[3] = val & 0xff;
+	gspca_dev->usb_buf[0] = val >> 24;
+	gspca_dev->usb_buf[1] = val >> 16;
+	gspca_dev->usb_buf[2] = val >> 8;
+	gspca_dev->usb_buf[3] = val;
 	ret = usb_bulk_msg(dev,
 			usb_sndbulkpipe(dev, 6),
-			bulk_buf,
+			gspca_dev->usb_buf,
 			4,
 			&alen,
 			500);	/* timeout in milliseconds */
@@ -303,7 +302,7 @@
 	cam->dev_name = (char *) id->driver_info;
 	cam->epaddr = 0x02;
 	gspca_dev->cam.cam_mode = vga_mode;
-	gspca_dev->cam.nmodes = sizeof vga_mode / sizeof vga_mode[0];
+	gspca_dev->cam.nmodes = ARRAY_SIZE(vga_mode);
 	sd->brightness = BRIGHTNESS_DEF;
 	sd->contrast = CONTRAST_DEF;
 	sd->colors = COLOR_DEF;
@@ -314,16 +313,15 @@
 /* this function is called at open time */
 static int sd_open(struct gspca_dev *gspca_dev)
 {
-	__u8 value;
 	int ret;
 
 	/* check if the device responds */
 	usb_set_interface(gspca_dev->dev, gspca_dev->iface, 1);
-	ret = reg_r(gspca_dev, 0x0740, &value);
+	ret = reg_r(gspca_dev, 0x0740);
 	if (ret < 0)
 		return ret;
-	if (value != 0xff) {
-		PDEBUG(D_ERR|D_STREAM, "init reg: 0x%02x", value);
+	if (ret != 0xff) {
+		PDEBUG(D_ERR|D_STREAM, "init reg: 0x%02x", ret);
 		return -1;
 	}
 	return 0;
@@ -332,7 +330,6 @@
 /* -- start the camera -- */
 static void sd_start(struct gspca_dev *gspca_dev)
 {
-	__u8 dum;
 	int ret, value;
 
 	/* work on alternate 1 */
@@ -355,11 +352,11 @@
 			gspca_dev->iface, gspca_dev->alt);
 		goto out;
 	}
-	ret = reg_r(gspca_dev, 0x0630, &dum);
+	ret = reg_r(gspca_dev, 0x0630);
 	if (ret < 0)
 		goto out;
-	rcv_val(gspca_dev, 0x000020, 4);	/* << (value ff ff ff ff) */
-	ret = reg_r(gspca_dev, 0x0650, &dum);
+	rcv_val(gspca_dev, 0x000020);	/* << (value ff ff ff ff) */
+	ret = reg_r(gspca_dev, 0x0650);
 	if (ret < 0)
 		goto out;
 	snd_val(gspca_dev, 0x000020, 0xffffffff);
@@ -389,14 +386,13 @@
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
-	__u8 value;
 
 	set_par(gspca_dev, 0x02000000);
 	set_par(gspca_dev, 0x02000000);
 	usb_set_interface(dev, gspca_dev->iface, 1);
-	reg_r(gspca_dev, 0x0630, &value);
-	rcv_val(gspca_dev, 0x000020, 4);	/* << (value ff ff ff ff) */
-	reg_r(gspca_dev, 0x0650, &value);
+	reg_r(gspca_dev, 0x0630);
+	rcv_val(gspca_dev, 0x000020);	/* << (value ff ff ff ff) */
+	reg_r(gspca_dev, 0x0650);
 	snd_val(gspca_dev, 0x000020, 0xffffffff);
 	reg_w(gspca_dev, 0x0620, 0);
 	reg_w(gspca_dev, 0x0630, 0);
@@ -538,10 +534,10 @@
 }
 
 /* sub-driver description */
-static struct sd_desc sd_desc = {
+static const struct sd_desc sd_desc = {
 	.name = MODULE_NAME,
 	.ctrls = sd_ctrls,
-	.nctrls = sizeof sd_ctrls / sizeof sd_ctrls[0],
+	.nctrls = ARRAY_SIZE(sd_ctrls),
 	.config = sd_config,
 	.open = sd_open,
 	.start = sd_start,
@@ -554,7 +550,7 @@
 
 /* -- module initialisation -- */
 #define DVNM(name) .driver_info = (kernel_ulong_t) name
-static __devinitdata struct usb_device_id device_table[] = {
+static const __devinitdata struct usb_device_id device_table[] = {
 	{USB_DEVICE(0x05e1, 0x0893), DVNM("Syntek DV4000")},
 	{}
 };
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c
index f66594a..acd4a07 100644
--- a/drivers/media/video/gspca/sunplus.c
+++ b/drivers/media/video/gspca/sunplus.c
@@ -24,8 +24,8 @@
 #include "gspca.h"
 #include "jpeg.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("GSPCA/SPCA5xx USB Camera Driver");
@@ -452,7 +452,7 @@
 	 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e}
 };
 
-static void spca5xxRegRead(struct usb_device *dev,
+static void reg_r(struct usb_device *dev,
 			   __u16 req,
 			   __u16 index,
 			   __u8 *buffer, __u16 length)
@@ -466,7 +466,7 @@
 			500);
 }
 
-static void spca5xxRegWrite(struct usb_device *dev,
+static void reg_w(struct usb_device *dev,
 			    __u16 req,
 			    __u16 value,
 			    __u16 index,
@@ -480,7 +480,8 @@
 			500);
 }
 
-static int reg_write(struct usb_device *dev,
+/* write req / index / value */
+static int reg_w_riv(struct usb_device *dev,
 		     __u16 req, __u16 index, __u16 value)
 {
 	int ret;
@@ -490,57 +491,56 @@
 			req,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			value, index, NULL, 0, 500);
-	PDEBUG(D_PACK, "reg write: 0x%02x,0x%02x:0x%02x, 0x%x",
+	PDEBUG(D_USBO, "reg write: 0x%02x,0x%02x:0x%02x, %d",
 		req, index, value, ret);
 	if (ret < 0)
 		PDEBUG(D_ERR, "reg write: error %d", ret);
 	return ret;
 }
 
-static int reg_read_info(struct usb_device *dev,
+/* read 1 byte */
+static int reg_r_1(struct gspca_dev *gspca_dev,
 			__u16 value)	/* wValue */
 {
 	int ret;
-	__u8 data;
 
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0x20,			/* request */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			value,
 			0,			/* index */
-			&data, 1,
+			gspca_dev->usb_buf, 1,
 			500);			/* timeout */
 	if (ret < 0) {
-		PDEBUG(D_ERR, "reg_read_info err %d", ret);
+		PDEBUG(D_ERR, "reg_r_1 err %d", ret);
 		return 0;
 	}
-	return data;
+	return gspca_dev->usb_buf[0];
 }
 
-/* returns: negative is error, pos or zero is data */
-static int reg_read(struct usb_device *dev,
+/* read 1 or 2 bytes - returns < 0 if error */
+static int reg_r_12(struct gspca_dev *gspca_dev,
 			__u16 req,	/* bRequest */
 			__u16 index,	/* wIndex */
 			__u16 length)	/* wLength (1 or 2 only) */
 {
 	int ret;
-	__u8 buf[2];
 
-	buf[1] = 0;
-	ret = usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	gspca_dev->usb_buf[1] = 0;
+	ret = usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
 			index,
-			buf, length,
+			gspca_dev->usb_buf, length,
 			500);
 	if (ret < 0) {
 		PDEBUG(D_ERR, "reg_read err %d", ret);
 		return -1;
 	}
-	return (buf[1] << 8) + buf[0];
+	return (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
 }
 
 static int write_vector(struct gspca_dev *gspca_dev,
@@ -550,7 +550,7 @@
 	int ret, i = 0;
 
 	while (data[i][0] != 0 || data[i][1] != 0 || data[i][2] != 0) {
-		ret = reg_write(dev, data[i][0], data[i][2], data[i][1]);
+		ret = reg_w_riv(dev, data[i][0], data[i][2], data[i][1]);
 		if (ret < 0) {
 			PDEBUG(D_ERR,
 				"Register write failed for 0x%x,0x%x,0x%x",
@@ -573,14 +573,14 @@
 
 	/* loop over y components */
 	for (i = 0; i < 64; i++) {
-		err = reg_write(dev, request, ybase + i, qtable[0][i]);
+		err = reg_w_riv(dev, request, ybase + i, qtable[0][i]);
 		if (err < 0)
 			return err;
 	}
 
 	/* loop over c components */
 	for (i = 0; i < 64; i++) {
-		err = reg_write(dev, request, cbase + i, qtable[1][i]);
+		err = reg_w_riv(dev, request, cbase + i, qtable[1][i]);
 		if (err < 0)
 			return err;
 	}
@@ -593,14 +593,14 @@
 	struct usb_device *dev = gspca_dev->dev;
 	__u8 notdone;
 
-	reg_write(dev, req, idx, val);
-	notdone = reg_read(dev, 0x01, 0x0001, 1);
-	reg_write(dev, req, idx, val);
+	reg_w_riv(dev, req, idx, val);
+	notdone = reg_r_12(gspca_dev, 0x01, 0x0001, 1);
+	reg_w_riv(dev, req, idx, val);
 
 	PDEBUG(D_FRAM, "before wait 0x%x", notdone);
 
 	msleep(200);
-	notdone = reg_read(dev, 0x01, 0x0001, 1);
+	notdone = reg_r_12(gspca_dev, 0x01, 0x0001, 1);
 	PDEBUG(D_FRAM, "after wait 0x%x", notdone);
 }
 
@@ -612,8 +612,8 @@
 	__u8 status;
 	__u8 endcode;
 
-	reg_write(dev, req, idx, val);
-	status = reg_read(dev, 0x01, 0x0001, 1);
+	reg_w_riv(dev, req, idx, val);
+	status = reg_r_12(gspca_dev, 0x01, 0x0001, 1);
 	endcode = stat;
 	PDEBUG(D_FRAM, "Status 0x%x Need 0x%x", status, stat);
 	if (!count)
@@ -622,8 +622,8 @@
 	while (--count > 0) {
 		msleep(10);
 		/* gsmart mini2 write a each wait setting 1 ms is enought */
-/*		reg_write(dev, req, idx, val); */
-		status = reg_read(dev, 0x01, 0x0001, 1);
+/*		reg_w_riv(dev, req, idx, val); */
+		status = reg_r_12(gspca_dev, 0x01, 0x0001, 1);
 		if (status == endcode) {
 			PDEBUG(D_FRAM, "status 0x%x after wait 0x%x",
 				status, 200 - count);
@@ -632,34 +632,31 @@
 	}
 }
 
-static int spca504B_PollingDataReady(struct usb_device *dev)
+static int spca504B_PollingDataReady(struct gspca_dev *gspca_dev)
 {
-	__u8 DataReady;
 	int count = 10;
 
 	while (--count > 0) {
-		spca5xxRegRead(dev, 0x21, 0, &DataReady, 1);
-		if ((DataReady & 0x01) == 0)
+		reg_r(gspca_dev->dev, 0x21, 0, gspca_dev->usb_buf, 1);
+		if ((gspca_dev->usb_buf[0] & 0x01) == 0)
 			break;
 		msleep(10);
 	}
-	return DataReady;
+	return gspca_dev->usb_buf[0];
 }
 
 static void spca504B_WaitCmdStatus(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
-	__u8 DataReady;
 	int count = 50;
 
 	while (--count > 0) {
-		spca5xxRegRead(dev, 0x21, 1, &DataReady, 1);
-
-		if (DataReady) {
-			DataReady = 0;
-			spca5xxRegWrite(dev, 0x21, 0, 1, &DataReady, 1);
-			spca5xxRegRead(dev, 0x21, 1, &DataReady, 1);
-			spca504B_PollingDataReady(dev);
+		reg_r(dev, 0x21, 1, gspca_dev->usb_buf, 1);
+		if (gspca_dev->usb_buf[0] != 0) {
+			gspca_dev->usb_buf[0] = 0;
+			reg_w(dev, 0x21, 0, 1, gspca_dev->usb_buf, 1);
+			reg_r(dev, 0x21, 1, gspca_dev->usb_buf, 1);
+			spca504B_PollingDataReady(gspca_dev);
 			break;
 		}
 		msleep(10);
@@ -669,14 +666,15 @@
 static void spca50x_GetFirmware(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
-	__u8 FW[5];
-	__u8 ProductInfo[64];
+	__u8 *data;
 
-	spca5xxRegRead(dev, 0x20, 0, FW, 5);
+	data = kmalloc(64, GFP_KERNEL);
+	reg_r(dev, 0x20, 0, data, 5);
 	PDEBUG(D_STREAM, "FirmWare : %d %d %d %d %d ",
-		FW[0], FW[1], FW[2], FW[3], FW[4]);
-	spca5xxRegRead(dev, 0x23, 0, ProductInfo, 64);
-	spca5xxRegRead(dev, 0x23, 1, ProductInfo, 64);
+		data[0], data[1], data[2], data[3], data[4]);
+	reg_r(dev, 0x23, 0, data, 64);
+	reg_r(dev, 0x23, 1, data, 64);
+	kfree(data);
 }
 
 static void spca504B_SetSizeType(struct gspca_dev *gspca_dev)
@@ -691,32 +689,35 @@
 	Type = 0;
 	switch (sd->bridge) {
 	case BRIDGE_SPCA533:
-		spca5xxRegWrite(dev, 0x31, 0, 0, NULL, 0);
+		reg_w(dev, 0x31, 0, 0, NULL, 0);
 		spca504B_WaitCmdStatus(gspca_dev);
-		rc = spca504B_PollingDataReady(dev);
+		rc = spca504B_PollingDataReady(gspca_dev);
 		spca50x_GetFirmware(gspca_dev);
-		Type = 2;
-		spca5xxRegWrite(dev, 0x24, 0, 8, &Type, 1);
-		spca5xxRegRead(dev, 0x24, 8, &Type, 1);
+		gspca_dev->usb_buf[0] = 2;			/* type */
+		reg_w(dev, 0x24, 0, 8, gspca_dev->usb_buf, 1);
+		reg_r(dev, 0x24, 8, gspca_dev->usb_buf, 1);
 
-		spca5xxRegWrite(dev, 0x25, 0, 4, &Size, 1);
-		spca5xxRegRead(dev, 0x25, 4, &Size, 1);
-		rc = spca504B_PollingDataReady(dev);
+		gspca_dev->usb_buf[0] = Size;
+		reg_w(dev, 0x25, 0, 4, gspca_dev->usb_buf, 1);
+		reg_r(dev, 0x25, 4, gspca_dev->usb_buf, 1);	/* size */
+		rc = spca504B_PollingDataReady(gspca_dev);
 
 		/* Init the cam width height with some values get on init ? */
-		spca5xxRegWrite(dev, 0x31, 0, 4, NULL, 0);
+		reg_w(dev, 0x31, 0, 4, NULL, 0);
 		spca504B_WaitCmdStatus(gspca_dev);
-		rc = spca504B_PollingDataReady(dev);
+		rc = spca504B_PollingDataReady(gspca_dev);
 		break;
 	default:
 /* case BRIDGE_SPCA504B: */
 /* case BRIDGE_SPCA536: */
+		gspca_dev->usb_buf[0] = Size;
+		reg_w(dev, 0x25, 0, 4, gspca_dev->usb_buf, 1);
+		reg_r(dev, 0x25, 4, gspca_dev->usb_buf, 1);	/* size */
 		Type = 6;
-		spca5xxRegWrite(dev, 0x25, 0, 4, &Size, 1);
-		spca5xxRegRead(dev, 0x25, 4, &Size, 1);
-		spca5xxRegWrite(dev, 0x27, 0, 0, &Type, 1);
-		spca5xxRegRead(dev, 0x27, 0, &Type, 1);
-		rc = spca504B_PollingDataReady(dev);
+		gspca_dev->usb_buf[0] = Type;
+		reg_w(dev, 0x27, 0, 0, gspca_dev->usb_buf, 1);
+		reg_r(dev, 0x27, 0, gspca_dev->usb_buf, 1);	/* type */
+		rc = spca504B_PollingDataReady(gspca_dev);
 		break;
 	case BRIDGE_SPCA504:
 		Size += 3;
@@ -733,21 +734,20 @@
 		break;
 	case BRIDGE_SPCA504C:
 		/* capture mode */
-		reg_write(dev, 0xa0, (0x0500 | (Size & 0x0f)), 0x0);
-		reg_write(dev, 0x20, 0x01, 0x0500 | (Size & 0x0f));
+		reg_w_riv(dev, 0xa0, (0x0500 | (Size & 0x0f)), 0x00);
+		reg_w_riv(dev, 0x20, 0x01, 0x0500 | (Size & 0x0f));
 		break;
 	}
 }
 
 static void spca504_wait_status(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int cnt;
 
 	cnt = 256;
 	while (--cnt > 0) {
 		/* With this we get the status, when return 0 it's all ok */
-		if (reg_read(dev, 0x06, 0x00, 1) == 0)
+		if (reg_r_12(gspca_dev, 0x06, 0x00, 1) == 0)
 			return;
 		msleep(10);
 	}
@@ -756,11 +756,11 @@
 static void spca504B_setQtable(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
-	__u8 Data = 3;
 
-	spca5xxRegWrite(dev, 0x26, 0, 0, &Data, 1);
-	spca5xxRegRead(dev, 0x26, 0, &Data, 1);
-	spca504B_PollingDataReady(dev);
+	gspca_dev->usb_buf[0] = 3;
+	reg_w(dev, 0x26, 0, 0, gspca_dev->usb_buf, 1);
+	reg_r(dev, 0x26, 0, gspca_dev->usb_buf, 1);
+	spca504B_PollingDataReady(gspca_dev);
 }
 
 static void sp5xx_initContBrigHueRegisters(struct gspca_dev *gspca_dev)
@@ -777,24 +777,24 @@
 	default:
 /*	case BRIDGE_SPCA533: */
 /*	case BRIDGE_SPCA504B: */
-		spca5xxRegWrite(dev, 0, 0, 0x21a7, NULL, 0);	/* brightness */
-		spca5xxRegWrite(dev, 0, 0x20, 0x21a8, NULL, 0);	/* contrast */
-		spca5xxRegWrite(dev, 0, 0, 0x21ad, NULL, 0);	/* hue */
-		spca5xxRegWrite(dev, 0, 1, 0x21ac, NULL, 0);	/* sat/hue */
-		spca5xxRegWrite(dev, 0, 0x20, 0x21ae, NULL, 0);	/* saturation */
-		spca5xxRegWrite(dev, 0, 0, 0x21a3, NULL, 0);	/* gamma */
+		reg_w(dev, 0, 0, 0x21a7, NULL, 0);	/* brightness */
+		reg_w(dev, 0, 0x20, 0x21a8, NULL, 0);	/* contrast */
+		reg_w(dev, 0, 0, 0x21ad, NULL, 0);	/* hue */
+		reg_w(dev, 0, 1, 0x21ac, NULL, 0);	/* sat/hue */
+		reg_w(dev, 0, 0x20, 0x21ae, NULL, 0);	/* saturation */
+		reg_w(dev, 0, 0, 0x21a3, NULL, 0);	/* gamma */
 		break;
 	case BRIDGE_SPCA536:
-		spca5xxRegWrite(dev, 0, 0, 0x20f0, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0x21, 0x20f1, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0x40, 0x20f5, NULL, 0);
-		spca5xxRegWrite(dev, 0, 1, 0x20f4, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0x40, 0x20f6, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0, 0x2089, NULL, 0);
+		reg_w(dev, 0, 0, 0x20f0, NULL, 0);
+		reg_w(dev, 0, 0x21, 0x20f1, NULL, 0);
+		reg_w(dev, 0, 0x40, 0x20f5, NULL, 0);
+		reg_w(dev, 0, 1, 0x20f4, NULL, 0);
+		reg_w(dev, 0, 0x40, 0x20f6, NULL, 0);
+		reg_w(dev, 0, 0, 0x2089, NULL, 0);
 		break;
 	}
 	if (pollreg)
-		spca504B_PollingDataReady(dev);
+		spca504B_PollingDataReady(gspca_dev);
 }
 
 /* this function is called at probe time */
@@ -872,7 +872,8 @@
 		case 0x504a:
 /* try to get the firmware as some cam answer 2.0.1.2.2
  * and should be a spca504b then overwrite that setting */
-			spca5xxRegRead(dev, 0x20, 0, &fw, 1);
+			reg_r(dev, 0x20, 0, gspca_dev->usb_buf, 1);
+			fw = gspca_dev->usb_buf[0];
 			if (fw == 1) {
 				sd->subtype = AiptekMiniPenCam13;
 				sd->bridge = BRIDGE_SPCA504;
@@ -1048,38 +1049,37 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct usb_device *dev = gspca_dev->dev;
 	int rc;
-	__u8 Data;
 	__u8 i;
 	__u8 info[6];
 	int err_code;
 
 	switch (sd->bridge) {
 	case BRIDGE_SPCA504B:
-		spca5xxRegWrite(dev, 0x1d, 0, 0, NULL, 0);
-		spca5xxRegWrite(dev, 0, 1, 0x2306, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0, 0x0d04, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0, 0x2000, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0x13, 0x2301, NULL, 0);
-		spca5xxRegWrite(dev, 0, 0, 0x2306, NULL, 0);
+		reg_w(dev, 0x1d, 0, 0, NULL, 0);
+		reg_w(dev, 0, 1, 0x2306, NULL, 0);
+		reg_w(dev, 0, 0, 0x0d04, NULL, 0);
+		reg_w(dev, 0, 0, 0x2000, NULL, 0);
+		reg_w(dev, 0, 0x13, 0x2301, NULL, 0);
+		reg_w(dev, 0, 0, 0x2306, NULL, 0);
 		/* fall thru */
 	case BRIDGE_SPCA533:
-		rc = spca504B_PollingDataReady(dev);
+		rc = spca504B_PollingDataReady(gspca_dev);
 		spca50x_GetFirmware(gspca_dev);
 		break;
 	case BRIDGE_SPCA536:
 		spca50x_GetFirmware(gspca_dev);
-		spca5xxRegRead(dev, 0x00, 0x5002, &Data, 1);
-		Data = 0;
-		spca5xxRegWrite(dev, 0x24, 0, 0, &Data, 1);
-		spca5xxRegRead(dev, 0x24, 0, &Data, 1);
-		rc = spca504B_PollingDataReady(dev);
-		spca5xxRegWrite(dev, 0x34, 0, 0, NULL, 0);
+		reg_r(dev, 0x00, 0x5002, gspca_dev->usb_buf, 1);
+		gspca_dev->usb_buf[0] = 0;
+		reg_w(dev, 0x24, 0, 0, gspca_dev->usb_buf, 1);
+		reg_r(dev, 0x24, 0, gspca_dev->usb_buf, 1);
+		rc = spca504B_PollingDataReady(gspca_dev);
+		reg_w(dev, 0x34, 0, 0, NULL, 0);
 		spca504B_WaitCmdStatus(gspca_dev);
 		break;
 	case BRIDGE_SPCA504C:	/* pccam600 */
 		PDEBUG(D_STREAM, "Opening SPCA504 (PC-CAM 600)");
-		reg_write(dev, 0xe0, 0x0000, 0x0000);
-		reg_write(dev, 0xe0, 0x0000, 0x0001);	/* reset */
+		reg_w_riv(dev, 0xe0, 0x0000, 0x0000);
+		reg_w_riv(dev, 0xe0, 0x0000, 0x0001);	/* reset */
 		spca504_wait_status(gspca_dev);
 		if (sd->subtype == LogitechClickSmart420)
 			write_vector(gspca_dev,
@@ -1100,7 +1100,7 @@
 		if (sd->subtype == AiptekMiniPenCam13) {
 			/*****************************/
 			for (i = 0; i < 6; i++)
-				info[i] = reg_read_info(dev, i);
+				info[i] = reg_r_1(gspca_dev, i);
 			PDEBUG(D_STREAM,
 				"Read info: %d %d %d %d %d %d."
 				" Should be 1,0,2,2,0,0",
@@ -1126,14 +1126,14 @@
 							6, 0, 0x86, 1); */
 /*			spca504A_acknowledged_command (gspca_dev, 0x24,
 							0, 0, 0x9D, 1); */
-			reg_write(dev, 0x0, 0x270c, 0x5); /* L92 sno1t.txt */
-			reg_write(dev, 0x0, 0x2310, 0x5);
+			reg_w_riv(dev, 0x0, 0x270c, 0x05); /* L92 sno1t.txt */
+			reg_w_riv(dev, 0x0, 0x2310, 0x05);
 			spca504A_acknowledged_command(gspca_dev, 0x01,
 							0x0f, 0, 0xff, 0);
 		}
 		/* setup qtable */
-		reg_write(dev, 0, 0x2000, 0);
-		reg_write(dev, 0, 0x2883, 1);
+		reg_w_riv(dev, 0, 0x2000, 0);
+		reg_w_riv(dev, 0, 0x2883, 1);
 		err_code = spca50x_setup_qtable(gspca_dev,
 						0x00, 0x2800,
 						0x2840,
@@ -1166,20 +1166,20 @@
 /*	case BRIDGE_SPCA536: */
 		if (sd->subtype == MegapixV4 ||
 		    sd->subtype == LogitechClickSmart820) {
-			spca5xxRegWrite(dev, 0xf0, 0, 0, NULL, 0);
+			reg_w(dev, 0xf0, 0, 0, NULL, 0);
 			spca504B_WaitCmdStatus(gspca_dev);
-			spca5xxRegRead(dev, 0xf0, 4, NULL, 0);
+			reg_r(dev, 0xf0, 4, NULL, 0);
 			spca504B_WaitCmdStatus(gspca_dev);
 		} else {
-			spca5xxRegWrite(dev, 0x31, 0, 4, NULL, 0);
+			reg_w(dev, 0x31, 0, 4, NULL, 0);
 			spca504B_WaitCmdStatus(gspca_dev);
-			rc = spca504B_PollingDataReady(dev);
+			rc = spca504B_PollingDataReady(gspca_dev);
 		}
 		break;
 	case BRIDGE_SPCA504:
 		if (sd->subtype == AiptekMiniPenCam13) {
 			for (i = 0; i < 6; i++)
-				info[i] = reg_read_info(dev, i);
+				info[i] = reg_r_1(gspca_dev, i);
 			PDEBUG(D_STREAM,
 				"Read info: %d %d %d %d %d %d."
 				" Should be 1,0,2,2,0,0",
@@ -1197,7 +1197,7 @@
 		} else {
 			spca504_acknowledged_command(gspca_dev, 0x24, 8, 3);
 			for (i = 0; i < 6; i++)
-				info[i] = reg_read_info(dev, i);
+				info[i] = reg_r_1(gspca_dev, i);
 			PDEBUG(D_STREAM,
 				"Read info: %d %d %d %d %d %d."
 				" Should be 1,0,2,2,0,0",
@@ -1207,8 +1207,8 @@
 			spca504_acknowledged_command(gspca_dev, 0x24, 0, 0);
 		}
 		spca504B_SetSizeType(gspca_dev);
-		reg_write(dev, 0x0, 0x270c, 0x5);	/* L92 sno1t.txt */
-		reg_write(dev, 0x0, 0x2310, 0x5);
+		reg_w_riv(dev, 0x0, 0x270c, 0x05);	/* L92 sno1t.txt */
+		reg_w_riv(dev, 0x0, 0x2310, 0x05);
 		break;
 	case BRIDGE_SPCA504C:
 		if (sd->subtype == LogitechClickSmart420) {
@@ -1217,13 +1217,13 @@
 		} else {
 			write_vector(gspca_dev, spca504_pccam600_init_data);
 		}
-		enable = (sd->autogain ? 0x4 : 0x1);
-		reg_write(dev, 0x0c, 0x0000, enable);	/* auto exposure */
-		reg_write(dev, 0xb0, 0x0000, enable);	/* auto whiteness */
+		enable = (sd->autogain ? 0x04 : 0x01);
+		reg_w_riv(dev, 0x0c, 0x0000, enable);	/* auto exposure */
+		reg_w_riv(dev, 0xb0, 0x0000, enable);	/* auto whiteness */
 
 		/* set default exposure compensation and whiteness balance */
-		reg_write(dev, 0x30, 0x0001, 800);	/* ~ 20 fps */
-		reg_write(dev, 0x30, 0x0002, 1600);
+		reg_w_riv(dev, 0x30, 0x0001, 800);	/* ~ 20 fps */
+		reg_w_riv(dev, 0x30, 0x0002, 1600);
 		spca504B_SetSizeType(gspca_dev);
 		break;
 	}
@@ -1240,13 +1240,13 @@
 /*	case BRIDGE_SPCA533: */
 /*	case BRIDGE_SPCA536: */
 /*	case BRIDGE_SPCA504B: */
-		spca5xxRegWrite(dev, 0x31, 0, 0, NULL, 0);
+		reg_w(dev, 0x31, 0, 0, NULL, 0);
 		spca504B_WaitCmdStatus(gspca_dev);
-		spca504B_PollingDataReady(dev);
+		spca504B_PollingDataReady(gspca_dev);
 		break;
 	case BRIDGE_SPCA504:
 	case BRIDGE_SPCA504C:
-		reg_write(dev, 0x00, 0x2000, 0x0000);
+		reg_w_riv(dev, 0x00, 0x2000, 0x0000);
 
 		if (sd->subtype == AiptekMiniPenCam13) {
 			/* spca504a aiptek */
@@ -1258,7 +1258,7 @@
 							0x0f, 0x00, 0xff, 1);
 		} else {
 			spca504_acknowledged_command(gspca_dev, 0x24, 0, 0);
-			reg_write(dev, 0x01, 0x000f, 0x0);
+			reg_w_riv(dev, 0x01, 0x000f, 0x00);
 		}
 		break;
 	}
@@ -1383,10 +1383,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		reg_write(dev, 0x0, 0x21a7, sd->brightness);
+		reg_w_riv(dev, 0x0, 0x21a7, sd->brightness);
 		break;
 	case BRIDGE_SPCA536:
-		reg_write(dev, 0x0, 0x20f0, sd->brightness);
+		reg_w_riv(dev, 0x0, 0x20f0, sd->brightness);
 		break;
 	}
 }
@@ -1394,7 +1394,6 @@
 static void getbrightness(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u16 brightness = 0;
 
 	switch (sd->bridge) {
@@ -1403,10 +1402,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		brightness = reg_read(dev, 0x0, 0x21a7, 2);
+		brightness = reg_r_12(gspca_dev, 0x00, 0x21a7, 2);
 		break;
 	case BRIDGE_SPCA536:
-		brightness = reg_read(dev, 0x0, 0x20f0, 2);
+		brightness = reg_r_12(gspca_dev, 0x00, 0x20f0, 2);
 		break;
 	}
 	sd->brightness = ((brightness & 0xff) - 128) % 255;
@@ -1423,10 +1422,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		reg_write(dev, 0x0, 0x21a8, sd->contrast);
+		reg_w_riv(dev, 0x0, 0x21a8, sd->contrast);
 		break;
 	case BRIDGE_SPCA536:
-		reg_write(dev, 0x0, 0x20f1, sd->contrast);
+		reg_w_riv(dev, 0x0, 0x20f1, sd->contrast);
 		break;
 	}
 }
@@ -1434,7 +1433,6 @@
 static void getcontrast(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	switch (sd->bridge) {
 	default:
@@ -1442,10 +1440,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		sd->contrast = reg_read(dev, 0x0, 0x21a8, 2);
+		sd->contrast = reg_r_12(gspca_dev, 0x00, 0x21a8, 2);
 		break;
 	case BRIDGE_SPCA536:
-		sd->contrast = reg_read(dev, 0x0, 0x20f1, 2);
+		sd->contrast = reg_r_12(gspca_dev, 0x00, 0x20f1, 2);
 		break;
 	}
 }
@@ -1461,10 +1459,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		reg_write(dev, 0x0, 0x21ae, sd->colors);
+		reg_w_riv(dev, 0x0, 0x21ae, sd->colors);
 		break;
 	case BRIDGE_SPCA536:
-		reg_write(dev, 0x0, 0x20f6, sd->colors);
+		reg_w_riv(dev, 0x0, 0x20f6, sd->colors);
 		break;
 	}
 }
@@ -1472,7 +1470,6 @@
 static void getcolors(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	switch (sd->bridge) {
 	default:
@@ -1480,10 +1477,10 @@
 /*	case BRIDGE_SPCA504B: */
 /*	case BRIDGE_SPCA504: */
 /*	case BRIDGE_SPCA504C: */
-		sd->colors = reg_read(dev, 0x0, 0x21ae, 2) >> 1;
+		sd->colors = reg_r_12(gspca_dev, 0x00, 0x21ae, 2) >> 1;
 		break;
 	case BRIDGE_SPCA536:
-		sd->colors = reg_read(dev, 0x0, 0x20f6, 2) >> 1;
+		sd->colors = reg_r_12(gspca_dev, 0x00, 0x20f6, 2) >> 1;
 		break;
 	}
 }
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c
index 299f845..00f47e4 100644
--- a/drivers/media/video/gspca/t613.c
+++ b/drivers/media/video/gspca/t613.c
@@ -26,8 +26,8 @@
 
 #define MODULE_NAME "t613"
 #include "gspca.h"
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 #define MAX_GAMMA 0x10		/* 0 to 15 */
 
@@ -365,48 +365,49 @@
 	{},
 };
 
-static void t16RegRead(struct usb_device *dev,
-		       __u16 index, __u8 *buffer, __u16 length)
+/* read 1 byte */
+static int reg_r_1(struct gspca_dev *gspca_dev,
+		   __u16 index)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0,		/* request */
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,		/* value */
-			index, buffer, length, 500);
+			index,
+			gspca_dev->usb_buf, 1, 500);
+	return gspca_dev->usb_buf[0];
 }
 
-static void t16RegWrite(struct usb_device *dev,
+static void reg_w(struct gspca_dev *gspca_dev,
 			__u16 value,
 			__u16 index,
 			const __u8 *buffer, __u16 len)
 {
 	if (buffer == NULL) {
-		usb_control_msg(dev,
-				usb_sndctrlpipe(dev, 0),
+		usb_control_msg(gspca_dev->dev,
+				usb_sndctrlpipe(gspca_dev->dev, 0),
 				0,
 			   USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 				value, index,
 				NULL, 0, 500);
 		return;
 	}
-	if (len < 16) {
-		__u8 tmpbuf[16];
-
-		memcpy(tmpbuf, buffer, len);
-		usb_control_msg(dev,
-				usb_sndctrlpipe(dev, 0),
+	if (len <= sizeof gspca_dev->usb_buf) {
+		memcpy(gspca_dev->usb_buf, buffer, len);
+		usb_control_msg(gspca_dev->dev,
+				usb_sndctrlpipe(gspca_dev->dev, 0),
 				0,
 			   USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 				value, index,
-				tmpbuf, len, 500);
+				gspca_dev->usb_buf, len, 500);
 	} else {
 		__u8 *tmpbuf;
 
 		tmpbuf = kmalloc(len, GFP_KERNEL);
 		memcpy(tmpbuf, buffer, len);
-		usb_control_msg(dev,
-				usb_sndctrlpipe(dev, 0),
+		usb_control_msg(gspca_dev->dev,
+				usb_sndctrlpipe(gspca_dev->dev, 0),
 				0,
 			   USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
 				value, index,
@@ -443,8 +444,6 @@
 
 static int init_default_parameters(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-
 	/* some of this registers are not really neded, because
 	 * they are overriden by setbrigthness, setcontrast, etc,
 	 * but wont hurt anyway, and can help someone with similar webcam
@@ -509,49 +508,49 @@
 	static const __u8 nset10[6] =
 			{ 0x0c, 0x03, 0xab, 0x10, 0x81, 0x20 };
 
-	t16RegWrite(dev, 0x01, 0x0000, n1, 0x06);
-	t16RegWrite(dev, 0x01, 0x0000, nset, 0x06);
-	t16RegRead(dev, 0x0063, &test_byte, 1);
-	t16RegWrite(dev, 0x01, 0x0000, n2, 0x02);
+	reg_w(gspca_dev, 0x01, 0x0000, n1, 0x06);
+	reg_w(gspca_dev, 0x01, 0x0000, nset, 0x06);
+	reg_r_1(gspca_dev, 0x0063);
+	reg_w(gspca_dev, 0x01, 0x0000, n2, 0x02);
 
 	while (read_indexs[i] != 0x00) {
-		t16RegRead(dev, read_indexs[i], &test_byte, 1);
-		PDEBUG(D_CONF, "Reg 0x%x => 0x%x", read_indexs[i],
+		test_byte = reg_r_1(gspca_dev, read_indexs[i]);
+		PDEBUG(D_CONF, "Reg 0x%02x => 0x%02x", read_indexs[i],
 		       test_byte);
 		i++;
 	}
 
-	t16RegWrite(dev, 0x01, 0x0000, n3, 0x06);
-	t16RegWrite(dev, 0x01, 0x0000, n4, 0x46);
-	t16RegRead(dev, 0x0080, &test_byte, 1);
-	t16RegWrite(dev, 0x00, 0x2c80, NULL, 0);
-	t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
-	t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
-	t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
-	t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
-	t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
-	t16RegWrite(dev, 0x00, 0x338e, NULL, 0);
-	t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04);
-	t16RegWrite(dev, 0x00, 0x00a9, NULL, 0);
-	t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22);
-	t16RegWrite(dev, 0x00, 0x86bb, NULL, 0);
-	t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, n3, 0x06);
+	reg_w(gspca_dev, 0x01, 0x0000, n4, 0x46);
+	reg_r_1(gspca_dev, 0x0080);
+	reg_w(gspca_dev, 0x00, 0x2c80, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, nset2, 0x14);
+	reg_w(gspca_dev, 0x01, 0x0000, nset3, 0x12);
+	reg_w(gspca_dev, 0x01, 0x0000, nset4, 0x12);
+	reg_w(gspca_dev, 0x00, 0x3880, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x3880, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x338e, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, nset5, 0x04);
+	reg_w(gspca_dev, 0x00, 0x00a9, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, nset6, 0x22);
+	reg_w(gspca_dev, 0x00, 0x86bb, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x4aa6, NULL, 0);
 
-	t16RegWrite(dev, 0x01, 0x0000, missing, 0x08);
+	reg_w(gspca_dev, 0x01, 0x0000, missing, 0x08);
 
-	t16RegWrite(dev, 0x00, 0x2087, NULL, 0);
-	t16RegWrite(dev, 0x00, 0x2088, NULL, 0);
-	t16RegWrite(dev, 0x00, 0x2089, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x2087, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x2088, NULL, 0);
+	reg_w(gspca_dev, 0x00, 0x2089, NULL, 0);
 
-	t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04);
-	t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06);
-	t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06);
-	t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04);
+	reg_w(gspca_dev, 0x01, 0x0000, nset7, 0x04);
+	reg_w(gspca_dev, 0x01, 0x0000, nset10, 0x06);
+	reg_w(gspca_dev, 0x01, 0x0000, nset8, 0x06);
+	reg_w(gspca_dev, 0x01, 0x0000, nset9, 0x04);
 
-	t16RegWrite(dev, 0x00, 0x2880, NULL, 0);
-	t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
-	t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
-	t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
+	reg_w(gspca_dev, 0x00, 0x2880, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, nset2, 0x14);
+	reg_w(gspca_dev, 0x01, 0x0000, nset3, 0x12);
+	reg_w(gspca_dev, 0x01, 0x0000, nset4, 0x12);
 
 	return 0;
 }
@@ -559,7 +558,6 @@
 static void setbrightness(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	unsigned int brightness;
 	__u8 set6[4] = { 0x8f, 0x26, 0xc3, 0x80 };
 	brightness = sd->brightness;
@@ -571,13 +569,12 @@
 		set6[3] = 0x00 + ((brightness - 7) * 0xa);
 	}
 
-	t16RegWrite(dev, 0x01, 0x0000, set6, 4);
+	reg_w(gspca_dev, 0x01, 0x0000, set6, 4);
 }
 
 static void setflip(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	__u8 flipcmd[8] =
 	    { 0x62, 0x07, 0x63, 0x03, 0x64, 0x00, 0x60, 0x09 };
@@ -585,15 +582,14 @@
 	if (sd->mirror == 1)
 		flipcmd[3] = 0x01;
 
-	t16RegWrite(dev, 0x01, 0x0000, flipcmd, 8);
+	reg_w(gspca_dev, 0x01, 0x0000, flipcmd, 8);
 }
 
 static void seteffect(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
-	t16RegWrite(dev, 0x01, 0x0000, effects_table[sd->effect], 0x06);
+	reg_w(gspca_dev, 0x01, 0x0000, effects_table[sd->effect], 0x06);
 	if (sd->effect == 1 || sd->effect == 5) {
 		PDEBUG(D_CONF,
 		       "This effect have been disabled for webcam \"safety\"");
@@ -601,15 +597,14 @@
 	}
 
 	if (sd->effect == 1 || sd->effect == 4)
-		t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
+		reg_w(gspca_dev, 0x00, 0x4aa6, NULL, 0);
 	else
-		t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0);
+		reg_w(gspca_dev, 0x00, 0xfaa6, NULL, 0);
 }
 
 static void setwhitebalance(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	__u8 white_balance[8] =
 	    { 0x87, 0x20, 0x88, 0x20, 0x89, 0x20, 0x80, 0x38 };
@@ -617,25 +612,23 @@
 	if (sd->whitebalance == 1)
 		white_balance[7] = 0x3c;
 
-	t16RegWrite(dev, 0x01, 0x0000, white_balance, 8);
+	reg_w(gspca_dev, 0x01, 0x0000, white_balance, 8);
 }
 
 static void setlightfreq(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 freq[4] = { 0x66, 0x40, 0xa8, 0xe8 };
 
 	if (sd->freq == 2)	/* 60hz */
 		freq[1] = 0x00;
 
-	t16RegWrite(dev, 0x1, 0x0000, freq, 0x4);
+	reg_w(gspca_dev, 0x1, 0x0000, freq, 0x4);
 }
 
 static void setcontrast(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	unsigned int contrast = sd->contrast;
 	__u16 reg_to_write = 0x00;
 
@@ -644,17 +637,16 @@
 	else
 		reg_to_write = (0x00a9 + ((contrast - 7) * 0x200));
 
-	t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
+	reg_w(gspca_dev, 0x00, reg_to_write, NULL, 0);
 }
 
 static void setcolors(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u16 reg_to_write;
 
 	reg_to_write = 0xc0bb + sd->colors * 0x100;
-	t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
+	reg_w(gspca_dev, 0x00, reg_to_write, NULL, 0);
 }
 
 static void setgamma(struct gspca_dev *gspca_dev)
@@ -664,12 +656,11 @@
 static void setsharpness(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	__u16 reg_to_write;
 
 	reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness;
 
-	t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
+	reg_w(gspca_dev, 0x00, reg_to_write, NULL, 0);
 }
 
 static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
@@ -837,13 +828,12 @@
 static int sd_setlowlight(struct gspca_dev *gspca_dev, __s32 val)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 
 	sd->autogain = val;
 	if (val != 0)
-		t16RegWrite(dev, 0x00, 0xf48e, NULL, 0);
+		reg_w(gspca_dev, 0x00, 0xf48e, NULL, 0);
 	else
-		t16RegWrite(dev, 0x00, 0xb48e, NULL, 0);
+		reg_w(gspca_dev, 0x00, 0xb48e, NULL, 0);
 	return 0;
 }
 
@@ -857,9 +847,7 @@
 
 static void sd_start(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	int mode;
-	__u8 test_byte;
 
 	static const __u8 t1[] = { 0x66, 0x00, 0xa8, 0xe8 };
 	__u8 t2[] = { 0x07, 0x00, 0x0d, 0x60, 0x0e, 0x80 };
@@ -886,21 +874,21 @@
 		break;
 	}
 
-	t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[0], 0x8);
-	t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8);
-	t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8);
-	t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
-	t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, tas5130a_sensor_init[0], 0x8);
+	reg_w(gspca_dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8);
+	reg_w(gspca_dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8);
+	reg_w(gspca_dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
+	reg_w(gspca_dev, 0x00, 0x3c80, NULL, 0);
 		/* just in case and to keep sync with logs  (for mine) */
-	t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
-	t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
+	reg_w(gspca_dev, 0x00, 0x3c80, NULL, 0);
 		/* just in case and to keep sync with logs  (for mine) */
-	t16RegWrite(dev, 0x01, 0x0000, t1, 4);
-	t16RegWrite(dev, 0x01, 0x0000, t2, 6);
-	t16RegRead(dev, 0x0012, &test_byte, 0x01);
-	t16RegWrite(dev, 0x01, 0x0000, t3, 0x10);
-	t16RegWrite(dev, 0x00, 0x0013, NULL, 0);
-	t16RegWrite(dev, 0x01, 0x0000, t4, 0x4);
+	reg_w(gspca_dev, 0x01, 0x0000, t1, 4);
+	reg_w(gspca_dev, 0x01, 0x0000, t2, 6);
+	reg_r_1(gspca_dev, 0x0012);
+	reg_w(gspca_dev, 0x01, 0x0000, t3, 0x10);
+	reg_w(gspca_dev, 0x00, 0x0013, NULL, 0);
+	reg_w(gspca_dev, 0x01, 0x0000, t4, 0x4);
 	/* restart on each start, just in case, sometimes regs goes wrong
 	 * when using controls from app */
 	setbrightness(gspca_dev);
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c
index f9bffd6..0b79389 100644
--- a/drivers/media/video/gspca/tv8532.c
+++ b/drivers/media/video/gspca/tv8532.c
@@ -22,8 +22,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
 MODULE_DESCRIPTION("TV8532 USB Camera Driver");
@@ -168,63 +168,74 @@
 	0x0c0509f1, 0
 };
 
-static void reg_r(struct usb_device *dev,
-		  __u16 index, __u8 *buffer)
+static int reg_r(struct gspca_dev *gspca_dev,
+		 __u16 index)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			TV8532_REQ_RegRead,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,	/* value */
-			index, buffer, sizeof(__u8),
+			index, gspca_dev->usb_buf, 1,
 			500);
+	return gspca_dev->usb_buf[0];
 }
 
-static void reg_w(struct usb_device *dev,
-		  __u16 index, __u8 *buffer, __u16 length)
+/* write 1 byte */
+static void reg_w_1(struct gspca_dev *gspca_dev,
+		  __u16 index, __u8 value)
 {
-	usb_control_msg(dev,
-			usb_sndctrlpipe(dev, 0),
+	gspca_dev->usb_buf[0] = value;
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
 			TV8532_REQ_RegWrite,
 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0,	/* value */
-			index, buffer, length, 500);
+			index, gspca_dev->usb_buf, 1, 500);
+}
+
+/* write 2 bytes */
+static void reg_w_2(struct gspca_dev *gspca_dev,
+		  __u16 index, __u8 val1, __u8 val2)
+{
+	gspca_dev->usb_buf[0] = val1;
+	gspca_dev->usb_buf[1] = val2;
+	usb_control_msg(gspca_dev->dev,
+			usb_sndctrlpipe(gspca_dev->dev, 0),
+			TV8532_REQ_RegWrite,
+			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+			0,	/* value */
+			index, gspca_dev->usb_buf, 2, 500);
 }
 
 static void tv_8532WriteEEprom(struct gspca_dev *gspca_dev)
 {
 	int i = 0;
-	__u8 reg, data0, data1, data2, datacmd;
-	struct usb_device *dev = gspca_dev->dev;
+	__u8 reg, data0, data1, data2;
 
-	datacmd = 0xb0;;
-	reg_w(dev, TV8532_GPIO, &datacmd, 1);
-	datacmd = TV8532_CMD_EEprom_Open;
-	reg_w(dev, TV8532_CTRL, &datacmd, 1);
+	reg_w_1(gspca_dev, TV8532_GPIO, 0xb0);
+	reg_w_1(gspca_dev, TV8532_CTRL, TV8532_CMD_EEprom_Open);
 /*	msleep(1); */
 	while (tv_8532_eeprom_data[i]) {
 		reg = (tv_8532_eeprom_data[i] & 0xff000000) >> 24;
-		reg_w(dev, TV8532_EEprom_Add, &reg, 1);
+		reg_w_1(gspca_dev, TV8532_EEprom_Add, reg);
 		/* msleep(1); */
 		data0 = (tv_8532_eeprom_data[i] & 0x000000ff);
-		reg_w(dev, TV8532_EEprom_DataL, &data0, 1);
+		reg_w_1(gspca_dev, TV8532_EEprom_DataL, data0);
 		/* msleep(1); */
-		data1 = (tv_8532_eeprom_data[i] & 0x0000FF00) >> 8;
-		reg_w(dev, TV8532_EEprom_DataM, &data1, 1);
+		data1 = (tv_8532_eeprom_data[i] & 0x0000ff00) >> 8;
+		reg_w_1(gspca_dev, TV8532_EEprom_DataM, data1);
 		/* msleep(1); */
-		data2 = (tv_8532_eeprom_data[i] & 0x00FF0000) >> 16;
-		reg_w(dev, TV8532_EEprom_DataH, &data2, 1);
+		data2 = (tv_8532_eeprom_data[i] & 0x00ff0000) >> 16;
+		reg_w_1(gspca_dev, TV8532_EEprom_DataH, data2);
 		/* msleep(1); */
-		datacmd = 0;
-		reg_w(dev, TV8532_EEprom_Write, &datacmd, 1);
+		reg_w_1(gspca_dev, TV8532_EEprom_Write, 0);
 		/* msleep(10); */
 		i++;
 	}
-	datacmd = i;
-	reg_w(dev, TV8532_EEprom_TableLength, &datacmd, 1);
+	reg_w_1(gspca_dev, TV8532_EEprom_TableLength, i);
 /*	msleep(1); */
-	datacmd = TV8532_CMD_EEprom_Close;
-	reg_w(dev, TV8532_CTRL, &datacmd, 1);
+	reg_w_1(gspca_dev, TV8532_CTRL, TV8532_CMD_EEprom_Close);
 	msleep(10);
 }
 
@@ -250,154 +261,121 @@
 
 static void tv_8532ReadRegisters(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
 	__u8 data;
-/*	__u16 vid, pid; */
 
-	reg_r(dev, 0x0001, &data);
+	data = reg_r(gspca_dev, 0x0001);
 	PDEBUG(D_USBI, "register 0x01-> %x", data);
-	reg_r(dev, 0x0002, &data);
+	data = reg_r(gspca_dev, 0x0002);
 	PDEBUG(D_USBI, "register 0x02-> %x", data);
-	reg_r(dev, TV8532_ADWIDTH_L, &data);
-	reg_r(dev, TV8532_ADWIDTH_H, &data);
-	reg_r(dev, TV8532_QUANT_COMP, &data);
-	reg_r(dev, TV8532_MODE_PACKET, &data);
-	reg_r(dev, TV8532_SETCLK, &data);
-	reg_r(dev, TV8532_POINT_L, &data);
-	reg_r(dev, TV8532_POINT_H, &data);
-	reg_r(dev, TV8532_POINTB_L, &data);
-	reg_r(dev, TV8532_POINTB_H, &data);
-	reg_r(dev, TV8532_BUDGET_L, &data);
-	reg_r(dev, TV8532_BUDGET_H, &data);
-	reg_r(dev, TV8532_VID_L, &data);
-	reg_r(dev, TV8532_VID_H, &data);
-	reg_r(dev, TV8532_PID_L, &data);
-	reg_r(dev, TV8532_PID_H, &data);
-	reg_r(dev, TV8532_DeviceID, &data);
-	reg_r(dev, TV8532_AD_COLBEGIN_L, &data);
-	reg_r(dev, TV8532_AD_COLBEGIN_H, &data);
-	reg_r(dev, TV8532_AD_ROWBEGIN_L, &data);
-	reg_r(dev, TV8532_AD_ROWBEGIN_H, &data);
+	reg_r(gspca_dev, TV8532_ADWIDTH_L);
+	reg_r(gspca_dev, TV8532_ADWIDTH_H);
+	reg_r(gspca_dev, TV8532_QUANT_COMP);
+	reg_r(gspca_dev, TV8532_MODE_PACKET);
+	reg_r(gspca_dev, TV8532_SETCLK);
+	reg_r(gspca_dev, TV8532_POINT_L);
+	reg_r(gspca_dev, TV8532_POINT_H);
+	reg_r(gspca_dev, TV8532_POINTB_L);
+	reg_r(gspca_dev, TV8532_POINTB_H);
+	reg_r(gspca_dev, TV8532_BUDGET_L);
+	reg_r(gspca_dev, TV8532_BUDGET_H);
+	reg_r(gspca_dev, TV8532_VID_L);
+	reg_r(gspca_dev, TV8532_VID_H);
+	reg_r(gspca_dev, TV8532_PID_L);
+	reg_r(gspca_dev, TV8532_PID_H);
+	reg_r(gspca_dev, TV8532_DeviceID);
+	reg_r(gspca_dev, TV8532_AD_COLBEGIN_L);
+	reg_r(gspca_dev, TV8532_AD_COLBEGIN_H);
+	reg_r(gspca_dev, TV8532_AD_ROWBEGIN_L);
+	reg_r(gspca_dev, TV8532_AD_ROWBEGIN_H);
 }
 
 static void tv_8532_setReg(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 data;
-	__u8 value[2] = { 0, 0 };
+	reg_w_1(gspca_dev, TV8532_AD_COLBEGIN_L,
+			ADCBEGINL);			/* 0x10 */
+	reg_w_1(gspca_dev, TV8532_AD_COLBEGIN_H,
+			ADCBEGINH);			/* also digital gain */
+	reg_w_1(gspca_dev, TV8532_PART_CTRL,
+			TV8532_CMD_UPDATE);		/* 0x00<-0x84 */
 
-	data = ADCBEGINL;
-	reg_w(dev, TV8532_AD_COLBEGIN_L, &data, 1);	/* 0x10 */
-	data = ADCBEGINH;	/* also digital gain */
-	reg_w(dev, TV8532_AD_COLBEGIN_H, &data, 1);
-	data = TV8532_CMD_UPDATE;
-	reg_w(dev, TV8532_PART_CTRL, &data, 1);	/* 0x00<-0x84 */
-
-	data = 0x0a;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0a);
 	/******************************************************/
-	data = ADHEIGHL;
-	reg_w(dev, TV8532_ADHEIGHT_L, &data, 1);	/* 0e */
-	data = ADHEIGHH;
-	reg_w(dev, TV8532_ADHEIGHT_H, &data, 1);	/* 0f */
-	value[0] = EXPOL;
-	value[1] = EXPOH;	/* 350d 0x014c; */
-	reg_w(dev, TV8532_EXPOSURE, value, 2);	/* 1c */
-	data = ADCBEGINL;
-	reg_w(dev, TV8532_AD_COLBEGIN_L, &data, 1);	/* 0x10 */
-	data = ADCBEGINH;	/* also digital gain */
-	reg_w(dev, TV8532_AD_COLBEGIN_H, &data, 1);
-	data = ADRBEGINL;
-	reg_w(dev, TV8532_AD_ROWBEGIN_L, &data, 1);	/* 0x14 */
+	reg_w_1(gspca_dev, TV8532_ADHEIGHT_L, ADHEIGHL); /* 0e */
+	reg_w_1(gspca_dev, TV8532_ADHEIGHT_H, ADHEIGHH); /* 0f */
+	reg_w_2(gspca_dev, TV8532_EXPOSURE,
+			EXPOL, EXPOH);			/* 350d 0x014c; 1c */
+	reg_w_1(gspca_dev, TV8532_AD_COLBEGIN_L,
+			ADCBEGINL);			/* 0x10 */
+	reg_w_1(gspca_dev, TV8532_AD_COLBEGIN_H,
+			ADCBEGINH);			/* also digital gain */
+	reg_w_1(gspca_dev, TV8532_AD_ROWBEGIN_L,
+			ADRBEGINL);			/* 0x14 */
 
-	data = 0x00;
-	reg_w(dev, TV8532_AD_SLOPE, &data, 1);	/* 0x91 */
-	data = 0x02;
-	reg_w(dev, TV8532_AD_BITCTRL, &data, 1);	/* 0x94 */
+	reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x00);	/* 0x91 */
+	reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x02);	/* 0x94 */
 
+	reg_w_1(gspca_dev, TV8532_CTRL,
+			TV8532_CMD_EEprom_Close);	/* 0x01 */
 
-	data = TV8532_CMD_EEprom_Close;
-	reg_w(dev, TV8532_CTRL, &data, 1);	/* 0x01 */
-
-	data = 0x00;
-	reg_w(dev, TV8532_AD_SLOPE, &data, 1);	/* 0x91 */
-	data = TV8532_CMD_UPDATE;
-	reg_w(dev, TV8532_PART_CTRL, &data, 1);	/* 0x00<-0x84 */
+	reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x00);	/* 0x91 */
+	reg_w_1(gspca_dev, TV8532_PART_CTRL,
+			TV8532_CMD_UPDATE);		/* 0x00<-0x84 */
 }
 
 static void tv_8532_PollReg(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 data;
 	int i;
 
 	/* strange polling from tgc */
 	for (i = 0; i < 10; i++) {
-		data = TESTCLK;	/* 0x48; //0x08; */
-		reg_w(dev, TV8532_SETCLK, &data, 1);	/* 0x2c */
-		data = TV8532_CMD_UPDATE;
-		reg_w(dev, TV8532_PART_CTRL, &data, 1);
-		data = 0x01;
-		reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+		reg_w_1(gspca_dev, TV8532_SETCLK,
+			TESTCLK);		/* 0x48; //0x08; 0x2c */
+		reg_w_1(gspca_dev, TV8532_PART_CTRL, TV8532_CMD_UPDATE);
+		reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x01);	/* 0x31 */
 	}
 }
 
 /* this function is called at open time */
 static int sd_open(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 data;
-	__u8 dataStart;
-	__u8 value[2];
-
-	data = 0x32;
-	reg_w(dev, TV8532_AD_SLOPE, &data, 1);
-	data = 0;
-	reg_w(dev, TV8532_AD_BITCTRL, &data, 1);
+	reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32);
+	reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00);
 	tv_8532ReadRegisters(gspca_dev);
-	data = 0x0b;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
-	value[0] = ADHEIGHL;
-	value[1] = ADHEIGHH;	/* 401d 0x0169; */
-	reg_w(dev, TV8532_ADHEIGHT_L, value, 2);	/* 0e */
-	value[0] = EXPOL;
-	value[1] = EXPOH;	/* 350d 0x014c; */
-	reg_w(dev, TV8532_EXPOSURE, value, 2);	/* 1c */
-	data = ADWIDTHL;	/* 0x20; */
-	reg_w(dev, TV8532_ADWIDTH_L, &data, 1);	/* 0x0c */
-	data = ADWIDTHH;
-	reg_w(dev, TV8532_ADWIDTH_H, &data, 1);	/* 0x0d */
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b);
+	reg_w_2(gspca_dev, TV8532_ADHEIGHT_L, ADHEIGHL,
+				ADHEIGHH);	/* 401d 0x0169; 0e */
+	reg_w_2(gspca_dev, TV8532_EXPOSURE, EXPOL,
+				EXPOH);		/* 350d 0x014c; 1c */
+	reg_w_1(gspca_dev, TV8532_ADWIDTH_L, ADWIDTHL);	/* 0x20; 0x0c */
+	reg_w_1(gspca_dev, TV8532_ADWIDTH_H, ADWIDTHH);	/* 0x0d */
 
 	/*******************************************************************/
-	data = TESTCOMP;	/* 0x72 compressed mode */
-	reg_w(dev, TV8532_QUANT_COMP, &data, 1);	/* 0x28 */
-	data = TESTLINE;	/* 0x84; // CIF | 4 packet */
-	reg_w(dev, TV8532_MODE_PACKET, &data, 1);	/* 0x29 */
+	reg_w_1(gspca_dev, TV8532_QUANT_COMP,
+			TESTCOMP);	/* 0x72 compressed mode 0x28 */
+	reg_w_1(gspca_dev, TV8532_MODE_PACKET,
+			TESTLINE);	/* 0x84; // CIF | 4 packet 0x29 */
 
 	/************************************************/
-	data = TESTCLK;		/* 0x48; //0x08; */
-	reg_w(dev, TV8532_SETCLK, &data, 1);	/* 0x2c */
-	data = TESTPTL;		/* 0x38; */
-	reg_w(dev, TV8532_POINT_L, &data, 1);	/* 0x2d */
-	data = TESTPTH;		/* 0x04; */
-	reg_w(dev, TV8532_POINT_H, &data, 1);	/* 0x2e */
-	dataStart = TESTPTBL;	/* 0x04; */
-	reg_w(dev, TV8532_POINTB_L, &dataStart, 1);	/* 0x2f */
-	data = TESTPTBH;	/* 0x04; */
-	reg_w(dev, TV8532_POINTB_H, &data, 1);	/* 0x30 */
-	data = TV8532_CMD_UPDATE;
-	reg_w(dev, TV8532_PART_CTRL, &data, 1);	/* 0x00<-0x84 */
+	reg_w_1(gspca_dev, TV8532_SETCLK,
+			TESTCLK);		/* 0x48; //0x08; 0x2c */
+	reg_w_1(gspca_dev, TV8532_POINT_L,
+			TESTPTL);		/* 0x38; 0x2d */
+	reg_w_1(gspca_dev, TV8532_POINT_H,
+			TESTPTH);		/* 0x04; 0x2e */
+	reg_w_1(gspca_dev, TV8532_POINTB_L,
+			TESTPTBL);		/* 0x04; 0x2f */
+	reg_w_1(gspca_dev, TV8532_POINTB_H,
+			TESTPTBH);		/* 0x04; 0x30 */
+	reg_w_1(gspca_dev, TV8532_PART_CTRL,
+			TV8532_CMD_UPDATE);	/* 0x00<-0x84 */
 	/*************************************************/
-	data = 0x01;
-	reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+	reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x01);	/* 0x31 */
 	msleep(200);
-	data = 0x00;
-	reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+	reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x00);	/* 0x31 */
 	/*************************************************/
 	tv_8532_setReg(gspca_dev);
 	/*************************************************/
-	data = 0x0b;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b);
 	/*************************************************/
 	tv_8532_setReg(gspca_dev);
 	/*************************************************/
@@ -408,94 +386,72 @@
 static void setbrightness(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	__u8 value[2];
-	__u8 data;
 	int brightness = sd->brightness;
 
-	value[1] = (brightness >> 8) & 0xff;
-	value[0] = (brightness) & 0xff;
-	reg_w(gspca_dev->dev, TV8532_EXPOSURE, value, 2);	/* 1c */
-	data = TV8532_CMD_UPDATE;
-	reg_w(gspca_dev->dev, TV8532_PART_CTRL, &data, 1);
+	reg_w_2(gspca_dev, TV8532_EXPOSURE,
+		brightness >> 8, brightness);		/* 1c */
+	reg_w_1(gspca_dev, TV8532_PART_CTRL, TV8532_CMD_UPDATE);
 }
 
 /* -- start the camera -- */
 static void sd_start(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 data;
-	__u8 value[2];
-
-	data = 0x32;
-	reg_w(dev, TV8532_AD_SLOPE, &data, 1);
-	data = 0;
-	reg_w(dev, TV8532_AD_BITCTRL, &data, 1);
+	reg_w_1(gspca_dev, TV8532_AD_SLOPE, 0x32);
+	reg_w_1(gspca_dev, TV8532_AD_BITCTRL, 0x00);
 	tv_8532ReadRegisters(gspca_dev);
-	data = 0x0b;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
-	value[0] = ADHEIGHL;
-	value[1] = ADHEIGHH;	/* 401d 0x0169; */
-	reg_w(dev, TV8532_ADHEIGHT_L, value, 2);	/* 0e */
-/*	value[0] = EXPOL; value[1] =EXPOH; 		 * 350d 0x014c; */
-/*	reg_w(dev,TV8532_REQ_RegWrite,0,TV8532_EXPOSURE,value,2);  * 1c */
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b);
+	reg_w_2(gspca_dev, TV8532_ADHEIGHT_L,
+		ADHEIGHL, ADHEIGHH);	/* 401d 0x0169; 0e */
+/*	reg_w_2(gspca_dev, TV8532_EXPOSURE,
+		EXPOL, EXPOH);		 * 350d 0x014c; 1c */
 	setbrightness(gspca_dev);
 
-	data = ADWIDTHL;	/* 0x20; */
-	reg_w(dev, TV8532_ADWIDTH_L, &data, 1);	/* 0x0c */
-	data = ADWIDTHH;
-	reg_w(dev, TV8532_ADWIDTH_H, &data, 1);	/* 0x0d */
+	reg_w_1(gspca_dev, TV8532_ADWIDTH_L, ADWIDTHL);	/* 0x20; 0x0c */
+	reg_w_1(gspca_dev, TV8532_ADWIDTH_H, ADWIDTHH);	/* 0x0d */
 
 	/************************************************/
-	data = TESTCOMP;	/* 0x72 compressed mode */
-	reg_w(dev, TV8532_QUANT_COMP, &data, 1);	/* 0x28 */
+	reg_w_1(gspca_dev, TV8532_QUANT_COMP,
+			TESTCOMP);	/* 0x72 compressed mode 0x28 */
 	if (gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv) {
 		/* 176x144 */
-		data = QCIFLINE;	/* 0x84; // CIF | 4 packet */
-		reg_w(dev, TV8532_MODE_PACKET, &data, 1);	/* 0x29 */
+		reg_w_1(gspca_dev, TV8532_MODE_PACKET,
+			QCIFLINE);	/* 0x84; // CIF | 4 packet 0x29 */
 	} else {
 		/* 352x288 */
-		data = TESTLINE;	/* 0x84; // CIF | 4 packet */
-		reg_w(dev, TV8532_MODE_PACKET, &data, 1);	/* 0x29 */
+		reg_w_1(gspca_dev, TV8532_MODE_PACKET,
+			TESTLINE);	/* 0x84; // CIF | 4 packet 0x29 */
 	}
 	/************************************************/
-	data = TESTCLK;		/* 0x48; //0x08; */
-	reg_w(dev, TV8532_SETCLK, &data, 1);	/* 0x2c */
-	data = TESTPTL;		/* 0x38; */
-	reg_w(dev, TV8532_POINT_L, &data, 1);	/* 0x2d */
-	data = TESTPTH;		/* 0x04; */
-	reg_w(dev, TV8532_POINT_H, &data, 1);	/* 0x2e */
-	data = TESTPTBL;	/* 0x04; */
-	reg_w(dev, TV8532_POINTB_L, &data, 1);	/* 0x2f */
-	data = TESTPTBH;	/* 0x04; */
-	reg_w(dev, TV8532_POINTB_H, &data, 1);	/* 0x30 */
-	data = TV8532_CMD_UPDATE;
-	reg_w(dev, TV8532_PART_CTRL, &data, 1);	/* 0x00<-0x84 */
+	reg_w_1(gspca_dev, TV8532_SETCLK,
+			TESTCLK);		/* 0x48; //0x08; 0x2c */
+	reg_w_1(gspca_dev, TV8532_POINT_L,
+			TESTPTL);		/* 0x38; 0x2d */
+	reg_w_1(gspca_dev, TV8532_POINT_H,
+			TESTPTH);		/* 0x04; 0x2e */
+	reg_w_1(gspca_dev, TV8532_POINTB_L,
+			TESTPTBL);		/* 0x04; 0x2f */
+	reg_w_1(gspca_dev, TV8532_POINTB_H,
+			TESTPTBH);		/* 0x04; 0x30 */
+	reg_w_1(gspca_dev, TV8532_PART_CTRL,
+			TV8532_CMD_UPDATE);	/* 0x00<-0x84 */
 	/************************************************/
-	data = 0x01;
-	reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+	reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x01);	/* 0x31 */
 	msleep(200);
-	data = 0x00;
-	reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+	reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x00);	/* 0x31 */
 	/************************************************/
 	tv_8532_setReg(gspca_dev);
 	/************************************************/
-	data = 0x0b;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b);
 	/************************************************/
 	tv_8532_setReg(gspca_dev);
 	/************************************************/
 	tv_8532_PollReg(gspca_dev);
-	data = 0x00;
-	reg_w(dev, TV8532_UDP_UPDATE, &data, 1);	/* 0x31 */
+	reg_w_1(gspca_dev, TV8532_UDP_UPDATE, 0x00);	/* 0x31 */
 }
 
 static void sd_stopN(struct gspca_dev *gspca_dev)
 {
-	struct usb_device *dev = gspca_dev->dev;
-	__u8 data;
-
-	data = 0x0b;
-	reg_w(dev, TV8532_GPIO_OE, &data, 1);
+	reg_w_1(gspca_dev, TV8532_GPIO_OE, 0x0b);
 }
 
 static void sd_stop0(struct gspca_dev *gspca_dev)
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c
index 668e024..dd7c138 100644
--- a/drivers/media/video/gspca/vc032x.c
+++ b/drivers/media/video/gspca/vc032x.c
@@ -1227,17 +1227,18 @@
 	{SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
 };
 
-static void reg_r(struct usb_device *dev,
-			   __u16 req,
-			   __u16 index,
-			   __u8 *buffer, __u16 length)
+/* read 'len' bytes in gspca_dev->usb_buf */
+static void reg_r(struct gspca_dev *gspca_dev,
+		  __u16 req,
+		  __u16 index,
+		  __u16 len)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			req,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			1,			/* value */
-			index, buffer, length,
+			index, gspca_dev->usb_buf, len,
 			500);
 }
 
@@ -1254,55 +1255,55 @@
 			500);
 }
 
-static void vc032x_read_sensor_register(struct usb_device *dev,
+static void read_sensor_register(struct gspca_dev *gspca_dev,
 				__u16 address, __u16 *value)
 {
+	struct usb_device *dev = gspca_dev->dev;
 	__u8 ldata, mdata, hdata;
-	__u8 tmpvalue = 0;
 	int retry = 50;
-	ldata = 0;
-	mdata = 0;
-	hdata = 0;
+
 	*value = 0;
 
-	reg_r(dev, 0xa1, 0xb33f, &tmpvalue, 1);
+	reg_r(gspca_dev, 0xa1, 0xb33f, 1);
 	/*PDEBUG(D_PROBE, " I2c Bus Busy Wait  0x%02X ", tmpvalue); */
-	if (!(tmpvalue & 0x02)) {
-		PDEBUG(D_ERR, "I2c Bus Busy Wait %d", tmpvalue & 0x02);
+	if (!(gspca_dev->usb_buf[0] & 0x02)) {
+		PDEBUG(D_ERR, "I2c Bus Busy Wait %d",
+			gspca_dev->usb_buf[0] & 0x02);
 		return;
 	}
 	reg_w(dev, 0xa0, address, 0xb33a);
 	reg_w(dev, 0xa0, 0x02, 0xb339);
 
-	tmpvalue = 0;
-	reg_r(dev, 0xa1, 0xb33b, &tmpvalue, 1);
-	while (retry-- && tmpvalue) {
-		reg_r(dev, 0xa1, 0xb33b, &tmpvalue, 1);
+	reg_r(gspca_dev, 0xa1, 0xb33b, 1);
+	while (retry-- && gspca_dev->usb_buf[0]) {
+		reg_r(gspca_dev, 0xa1, 0xb33b, 1);
 /*		PDEBUG(D_PROBE, "Read again 0xb33b %d", tmpvalue); */
 		msleep(1);
 	}
-	reg_r(dev, 0xa1, 0xb33e, &hdata, 1);
-	reg_r(dev, 0xa1, 0xb33d, &mdata, 1);
-	reg_r(dev, 0xa1, 0xb33c, &ldata, 1);
+	reg_r(gspca_dev, 0xa1, 0xb33e, 1);
+	hdata = gspca_dev->usb_buf[0];
+	reg_r(gspca_dev, 0xa1, 0xb33d, 1);
+	mdata = gspca_dev->usb_buf[0];
+	reg_r(gspca_dev, 0xa1, 0xb33c, 1);
+	ldata = gspca_dev->usb_buf[0];
 	PDEBUG(D_PROBE, "Read Sensor h (0x%02X) m (0x%02X) l (0x%02X)",
 		hdata, mdata, ldata);
-	tmpvalue = 0;
-	reg_r(dev, 0xa1, 0xb334, &tmpvalue, 1);
-	if (tmpvalue == 0x02)
+	reg_r(gspca_dev, 0xa1, 0xb334, 1);
+	if (gspca_dev->usb_buf[0] == 0x02)
 		*value = (ldata << 8) + mdata;
 	else
 		*value = ldata;
 }
+
 static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
 {
 	struct usb_device *dev = gspca_dev->dev;
 	int i;
-	__u8 data;
 	__u16 value;
 	const struct sensor_info *ptsensor_info;
 
-	reg_r(dev, 0xa1, 0xbfcf, &data, 1);
-	PDEBUG(D_PROBE, "check sensor header %d", data);
+	reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
+	PDEBUG(D_PROBE, "check sensor header %d", gspca_dev->usb_buf[0]);
 	for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
 		ptsensor_info = &sensor_info_data[i];
 		reg_w(dev, 0xa0, 0x02, 0xb334);
@@ -1315,7 +1316,7 @@
 			"check sensor VC032X -> %d Add -> ox%02X!",
 			i, ptsensor_info->I2cAdd); */
 		reg_w(dev, 0xa0, ptsensor_info->op, 0xb301);
-		vc032x_read_sensor_register(dev, ptsensor_info->IdAdd, &value);
+		read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value);
 		if (value == ptsensor_info->VpId) {
 /*			PDEBUG(D_PROBE, "find sensor VC032X -> ox%04X!",
 				ptsensor_info->VpId); */
@@ -1325,14 +1326,14 @@
 	return -1;
 }
 
-static __u8 i2c_write(struct usb_device *dev,
+static __u8 i2c_write(struct gspca_dev *gspca_dev,
 			__u8 reg, const __u8 *val, __u8 size)
 {
-	__u8 retbyte;
+	struct usb_device *dev = gspca_dev->dev;
 
 	if (size > 3 || size < 1)
 		return -EINVAL;
-	reg_r(dev, 0xa1, 0xb33f, &retbyte, 1);
+	reg_r(gspca_dev, 0xa1, 0xb33f, 1);
 	reg_w(dev, 0xa0, size, 0xb334);
 	reg_w(dev, 0xa0, reg, 0xb33a);
 	switch (size) {
@@ -1353,8 +1354,8 @@
 		return -EINVAL;
 	}
 	reg_w(dev, 0xa0, 0x01, 0xb339);
-	reg_r(dev, 0xa1, 0xb33b, &retbyte, 1);
-	return retbyte == 0;
+	reg_r(gspca_dev, 0xa1, 0xb33b, 1);
+	return gspca_dev->usb_buf[0] == 0;
 }
 
 static void put_tab_to_reg(struct gspca_dev *gspca_dev,
@@ -1382,10 +1383,10 @@
 					((data[i][0])<<8) | data[i][1]);
 			break;
 		case 0xaa:			/* i2c op */
-			i2c_write(dev, data[i][1], &data[i][2], 1);
+			i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
 			break;
 		case 0xbb:			/* i2c op */
-			i2c_write(dev, data[i][0], &data[i][1], 2);
+			i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
 			break;
 		case 0xdd:
 			msleep(data[i][2] + 10);
@@ -1417,7 +1418,6 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct usb_device *dev = gspca_dev->dev;
 	struct cam *cam;
-	__u8 tmp2[4];
 	int sensor;
 	__u16 product;
 
@@ -1488,10 +1488,10 @@
 	sd->lightfreq = FREQ_DEF;
 
 	if (sd->bridge == BRIDGE_VC0321) {
-		reg_r(dev, 0x8a, 0, tmp2, 3);
+		reg_r(gspca_dev, 0x8a, 0, 3);
 		reg_w(dev, 0x87, 0x00, 0x0f0f);
 
-		reg_r(dev, 0x8b, 0, tmp2, 3);
+		reg_r(gspca_dev, 0x8b, 0, 3);
 		reg_w(dev, 0x88, 0x00, 0x0202);
 	}
 	return 0;
@@ -1525,7 +1525,6 @@
 static void sd_start(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-/*	__u8 tmp2; */
 	const __u8 *GammaT = NULL;
 	const __u8 *MatrixT = NULL;
 	int mode;
@@ -1627,7 +1626,7 @@
 		reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb824);
 		*/
 		/* Only works for HV7131R ??
-		reg_r (gspca_dev->dev, 0xa1, 0xb881, &tmp2, 1);
+		reg_r (gspca_dev, 0xa1, 0xb881, 1);
 		reg_w(gspca_dev->dev, 0xa0, 0xfe01, 0xb881);
 		reg_w(gspca_dev->dev, 0xa0, 0x79, 0xb801);
 		*/
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index bac45a1..548c4c8 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -24,8 +24,8 @@
 
 #include "gspca.h"
 
-#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 5)
-static const char version[] = "2.1.5";
+#define DRIVER_VERSION_NUMBER	KERNEL_VERSION(2, 1, 7)
+static const char version[] = "2.1.7";
 
 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>, "
 		"Serge A. Suchkov <Serge.A.S@tochka.ru>");
@@ -6214,23 +6214,27 @@
 	{}
 };
 
-static void reg_r_i(struct usb_device *dev,
-		__u16 index, __u8 *buffer)
+static int reg_r_i(struct gspca_dev *gspca_dev,
+		__u16 index)
 {
-	usb_control_msg(dev,
-			usb_rcvctrlpipe(dev, 0),
+	usb_control_msg(gspca_dev->dev,
+			usb_rcvctrlpipe(gspca_dev->dev, 0),
 			0xa1,
 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
 			0x01,			/* value */
-			index, buffer, 1,
+			index, gspca_dev->usb_buf, 1,
 			500);
+	return gspca_dev->usb_buf[0];
 }
 
-static void reg_r(struct usb_device *dev,
-		__u16 index, __u8 *buffer)
+static int reg_r(struct gspca_dev *gspca_dev,
+		__u16 index)
 {
-	reg_r_i(dev, index, buffer);
-	PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, *buffer);
+	int ret;
+
+	ret = reg_r_i(gspca_dev, index);
+	PDEBUG(D_USBI, "reg r [%04x] -> %02x", index, ret);
+	return ret;
 }
 
 static void reg_w_i(struct usb_device *dev,
@@ -6253,55 +6257,54 @@
 	reg_w_i(dev, value, index);
 }
 
-static __u16 i2c_read(struct usb_device *dev, __u8 reg)
+static __u16 i2c_read(struct gspca_dev *gspca_dev,
+			__u8 reg)
 {
 	__u8 retbyte;
 	__u8 retval[2];
 
-	reg_w_i(dev, reg, 0x92);
-	reg_w_i(dev, 0x02, 0x90);		/* <- read command */
+	reg_w_i(gspca_dev->dev, reg, 0x92);
+	reg_w_i(gspca_dev->dev, 0x02, 0x90);		/* <- read command */
 	msleep(25);
-	reg_r_i(dev, 0x0091, &retbyte);		/* read status */
-	reg_r_i(dev, 0x0095, &retval[0]);	/* read Lowbyte */
-	reg_r_i(dev, 0x0096, &retval[1]);	/* read Hightbyte */
+	retbyte = reg_r_i(gspca_dev, 0x0091);		/* read status */
+	retval[0] = reg_r_i(gspca_dev, 0x0095);		/* read Lowbyte */
+	retval[1] = reg_r_i(gspca_dev, 0x0096);		/* read Hightbyte */
 	PDEBUG(D_USBO, "i2c r [%02x] -> (%02x) %02x%02x",
 			reg, retbyte, retval[1], retval[0]);
 	return (retval[1] << 8) | retval[0];
 }
 
-static __u8 i2c_write(struct usb_device *dev,
+static __u8 i2c_write(struct gspca_dev *gspca_dev,
 			__u8 reg,
 			__u8 valL,
 			__u8 valH)
 {
 	__u8 retbyte;
 
-	reg_w_i(dev, reg, 0x92);
-	reg_w_i(dev, valL, 0x93);
-	reg_w_i(dev, valH, 0x94);
-	reg_w_i(dev, 0x01, 0x90);		/* <- write command */
+	reg_w_i(gspca_dev->dev, reg, 0x92);
+	reg_w_i(gspca_dev->dev, valL, 0x93);
+	reg_w_i(gspca_dev->dev, valH, 0x94);
+	reg_w_i(gspca_dev->dev, 0x01, 0x90);		/* <- write command */
 	msleep(5);
-	reg_r_i(dev, 0x0091, &retbyte);		/* read status */
+	retbyte = reg_r_i(gspca_dev, 0x0091);		/* read status */
 	PDEBUG(D_USBO, "i2c w [%02x] %02x%02x (%02x)",
 			reg, valH, valL, retbyte);
 	return retbyte;
 }
 
-static void usb_exchange(struct usb_device *dev,
+static void usb_exchange(struct gspca_dev *gspca_dev,
 			const struct usb_action *action)
 {
-	__u8 buffread;
-
 	while (action->req) {
 		switch (action->req) {
 		case 0xa0:	/* write register */
-			reg_w(dev, action->val, action->idx);
+			reg_w(gspca_dev->dev, action->val, action->idx);
 			break;
 		case 0xa1:	/* read status */
-			reg_r(dev, action->idx, &buffread);
+			reg_r(gspca_dev, action->idx);
 			break;
 		case 0xaa:
-			i2c_write(dev,
+			i2c_write(gspca_dev,
 				  action->val,			/* reg */
 				  action->idx & 0xff,		/* valL */
 				  action->idx >> 8);		/* valH */
@@ -6376,7 +6379,6 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct usb_device *dev = gspca_dev->dev;
 	int sharpness;
-	__u8 retbyte;
 	static const __u8 sharpness_tb[][2] = {
 		{0x02, 0x03},
 		{0x04, 0x07},
@@ -6386,9 +6388,9 @@
 
 	sharpness = sd->sharpness;
 	reg_w(dev, sharpness_tb[sharpness][0], 0x01c6);
-	reg_r(dev, 0x01c8, &retbyte);
-	reg_r(dev, 0x01c9, &retbyte);
-	reg_r(dev, 0x01ca, &retbyte);
+	reg_r(gspca_dev, 0x01c8);
+	reg_r(gspca_dev, 0x01c9);
+	reg_r(gspca_dev, 0x01ca);
 	reg_w(dev, sharpness_tb[sharpness][1], 0x01cb);
 }
 
@@ -6398,7 +6400,7 @@
 	struct usb_device *dev = gspca_dev->dev;
 	const __u8 *Tgamma, *Tgradient;
 	int g, i, k;
-	static const __u8 kgamma_tb[16] =		/* delta for contrast */
+	static const __u8 kgamma_tb[16] =	/* delta for contrast */
 		{0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08,
 		 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
 	static const __u8 kgrad_tb[16] =
@@ -6623,7 +6625,7 @@
 		i++;			/* 640x480 */
 	zc3_freq = freq_tb[(int) sd->sensor][i];
 	if (zc3_freq != NULL) {
-		usb_exchange(gspca_dev->dev, zc3_freq);
+		usb_exchange(gspca_dev, zc3_freq);
 		switch (sd->sensor) {
 		case SENSOR_GC0305:
 			if (mode			/* if 320x240 */
@@ -6687,44 +6689,45 @@
 /*	msleep(2); */
 }
 
-static int sif_probe(struct usb_device *dev)
+static int sif_probe(struct gspca_dev *gspca_dev)
 {
 	__u16 checkword;
 
-	start_2wr_probe(dev, 0x0f);		/* PAS106 */
-	reg_w(dev, 0x08, 0x008d);
+	start_2wr_probe(gspca_dev->dev, 0x0f);		/* PAS106 */
+	reg_w(gspca_dev->dev, 0x08, 0x008d);
 	msleep(150);
-	checkword = ((i2c_read(dev, 0x00) & 0x0f) << 4)
-			| ((i2c_read(dev, 0x01) & 0xf0) >> 4);
+	checkword = ((i2c_read(gspca_dev, 0x00) & 0x0f) << 4)
+			| ((i2c_read(gspca_dev, 0x01) & 0xf0) >> 4);
 	PDEBUG(D_PROBE, "probe sif 0x%04x", checkword);
 	if (checkword == 0x0007) {
-		send_unknown(dev, SENSOR_PAS106);
+		send_unknown(gspca_dev->dev, SENSOR_PAS106);
 		return 0x0f;			/* PAS106 */
 	}
 	return -1;
 }
 
-static int vga_2wr_probe(struct usb_device *dev)
+static int vga_2wr_probe(struct gspca_dev *gspca_dev)
 {
+	struct usb_device *dev = gspca_dev->dev;
 	__u8 retbyte;
 	__u16 checkword;
 
 	start_2wr_probe(dev, 0x00);		/* HV7131B */
-	i2c_write(dev, 0x01, 0xaa, 0x00);
-	retbyte = i2c_read(dev, 0x01);
+	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x01);
 	if (retbyte != 0)
 		return 0x00;			/* HV7131B */
 
 	start_2wr_probe(dev, 0x04);		/* CS2102 */
-	i2c_write(dev, 0x01, 0xaa, 0x00);
-	retbyte = i2c_read(dev, 0x01);
+	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x01);
 	if (retbyte != 0)
 		return 0x04;			/* CS2102 */
 
 	start_2wr_probe(dev, 0x06);		/* OmniVision */
 	reg_w(dev, 0x08, 0x8d);
-	i2c_write(dev, 0x11, 0xaa, 0x00);
-	retbyte = i2c_read(dev, 0x11);
+	i2c_write(gspca_dev, 0x11, 0xaa, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x11);
 	if (retbyte != 0) {
 		/* (should have returned 0xaa) --> Omnivision? */
 		/* reg_r 0x10 -> 0x06 -->  */
@@ -6732,45 +6735,45 @@
 	}
 
 	start_2wr_probe(dev, 0x08);		/* HDCS2020 */
-	i2c_write(dev, 0x15, 0xaa, 0x00);
-	retbyte = i2c_read(dev, 0x15);
+	i2c_write(gspca_dev, 0x15, 0xaa, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x15);
 	if (retbyte != 0)
 		return 0x08;			/* HDCS2020 */
 
 	start_2wr_probe(dev, 0x0a);		/* PB0330 */
-	i2c_write(dev, 0x07, 0xaa, 0xaa);
-	retbyte = i2c_read(dev, 0x07);
+	i2c_write(gspca_dev, 0x07, 0xaa, 0xaa);
+	retbyte = i2c_read(gspca_dev, 0x07);
 	if (retbyte != 0)
 		return 0x0a;			/* PB0330 */
-	retbyte = i2c_read(dev, 0x03);
+	retbyte = i2c_read(gspca_dev, 0x03);
 	if (retbyte != 0)
 		return 0x0a;			/* PB0330 ?? */
-	retbyte = i2c_read(dev, 0x04);
+	retbyte = i2c_read(gspca_dev, 0x04);
 	if (retbyte != 0)
 		return 0x0a;			/* PB0330 ?? */
 
 	start_2wr_probe(dev, 0x0c);		/* ICM105A */
-	i2c_write(dev, 0x01, 0x11, 0x00);
-	retbyte = i2c_read(dev, 0x01);
+	i2c_write(gspca_dev, 0x01, 0x11, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x01);
 	if (retbyte != 0)
 		return 0x0c;			/* ICM105A */
 
 	start_2wr_probe(dev, 0x0e);		/* PAS202BCB */
 	reg_w(dev, 0x08, 0x8d);
-	i2c_write(dev, 0x03, 0xaa, 0x00);
+	i2c_write(gspca_dev, 0x03, 0xaa, 0x00);
 	msleep(500);
-	retbyte = i2c_read(dev, 0x03);
+	retbyte = i2c_read(gspca_dev, 0x03);
 	if (retbyte != 0)
 		return 0x0e;			/* PAS202BCB */
 
 	start_2wr_probe(dev, 0x02);		/* ?? */
-	i2c_write(dev, 0x01, 0xaa, 0x00);
-	retbyte = i2c_read(dev, 0x01);
+	i2c_write(gspca_dev, 0x01, 0xaa, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x01);
 	if (retbyte != 0)
 		return 0x02;			/* ?? */
 ov_check:
-	reg_r(dev, 0x0010, &retbyte);		/* ?? */
-	reg_r(dev, 0x0010, &retbyte);
+	reg_r(gspca_dev, 0x0010);		/* ?? */
+	reg_r(gspca_dev, 0x0010);
 
 	reg_w(dev, 0x01, 0x0000);
 	reg_w(dev, 0x01, 0x0001);
@@ -6779,10 +6782,10 @@
 	reg_w(dev, 0x08, 0x008d);
 	msleep(500);
 	reg_w(dev, 0x01, 0x0012);
-	i2c_write(dev, 0x12, 0x80, 0x00);	/* sensor reset */
-	retbyte = i2c_read(dev, 0x0a);
+	i2c_write(gspca_dev, 0x12, 0x80, 0x00);	/* sensor reset */
+	retbyte = i2c_read(gspca_dev, 0x0a);
 	checkword = retbyte << 8;
-	retbyte = i2c_read(dev, 0x0b);
+	retbyte = i2c_read(gspca_dev, 0x0b);
 	checkword |= retbyte;
 	PDEBUG(D_PROBE, "probe 2wr ov vga 0x%04x", checkword);
 	switch (checkword) {
@@ -6821,7 +6824,7 @@
 
 /*fixme: lack of 8b=b3 (11,12)-> 10, 8b=e0 (14,15,16)-> 12 found in gspcav1*/
 	reg_w(dev, 0x02, 0x0010);
-	reg_r(dev, 0x10, &retbyte);
+	reg_r(gspca_dev, 0x10);
 	reg_w(dev, 0x01, 0x0000);
 	reg_w(dev, 0x00, 0x0010);
 	reg_w(dev, 0x01, 0x0001);
@@ -6829,23 +6832,23 @@
 	reg_w(dev, 0x03, 0x0012);
 	reg_w(dev, 0x01, 0x0012);
 	reg_w(dev, 0x05, 0x0012);
-	retbyte = i2c_read(dev, 0x14);
+	retbyte = i2c_read(gspca_dev, 0x14);
 	if (retbyte != 0)
 		return 0x11;			/* HV7131R */
-	retbyte = i2c_read(dev, 0x15);
+	retbyte = i2c_read(gspca_dev, 0x15);
 	if (retbyte != 0)
 		return 0x11;			/* HV7131R */
-	retbyte = i2c_read(dev, 0x16);
+	retbyte = i2c_read(gspca_dev, 0x16);
 	if (retbyte != 0)
 		return 0x11;			/* HV7131R */
 
 	reg_w(dev, 0x02, 0x0010);
-	reg_r(dev, 0x000b, &retbyte);
+	retbyte = reg_r(gspca_dev, 0x000b);
 	checkword = retbyte << 8;
-	reg_r(dev, 0x000a, &retbyte);
+	retbyte = reg_r(gspca_dev, 0x000a);
 	checkword |= retbyte;
 	PDEBUG(D_PROBE, "probe 3wr vga 1 0x%04x", checkword);
-	reg_r(dev, 0x0010, &retbyte);
+	reg_r(gspca_dev, 0x0010);
 	/* this is tested only once anyway */
 	i = 0;
 	while (chipset_revision_sensor[i].revision) {
@@ -6863,7 +6866,7 @@
 	reg_w(dev, 0x0a, 0x0010);
 	reg_w(dev, 0x03, 0x0012);
 	reg_w(dev, 0x01, 0x0012);
-	retbyte = i2c_read(dev, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x00);
 	if (retbyte != 0) {
 		PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
 		return 0x0a;			/* ?? */
@@ -6876,7 +6879,7 @@
 	reg_w(dev, 0x03, 0x0012);
 	msleep(2);
 	reg_w(dev, 0x01, 0x0012);
-	retbyte = i2c_read(dev, 0x00);
+	retbyte = i2c_read(gspca_dev, 0x00);
 	if (retbyte != 0) {
 		PDEBUG(D_PROBE, "probe 3wr vga type %02x", retbyte);
 		send_unknown(dev, SENSOR_GC0305);
@@ -6890,8 +6893,8 @@
 	reg_w(dev, 0x06, 0x0010);
 	reg_w(dev, 0x01, 0x0012);
 	reg_w(dev, 0x05, 0x0012);
-	if (i2c_read(dev, 0x1c) == 0x7f	/* OV7610 - manufacturer ID */
-	    && i2c_read(dev, 0x1d) == 0xa2) {
+	if (i2c_read(gspca_dev, 0x1c) == 0x7f	/* OV7610 - manufacturer ID */
+	    && i2c_read(gspca_dev, 0x1d) == 0xa2) {
 		send_unknown(dev, SENSOR_OV7620);
 		return 0x06;		/* OmniVision confirm ? */
 	}
@@ -6905,13 +6908,13 @@
 /*	msleep(150); */
 	reg_w(dev, 0x01, 0x12);
 	reg_w(dev, 0x05, 0x12);
-	retbyte = i2c_read(dev, 0x00);		/* ID 0 */
+	retbyte = i2c_read(gspca_dev, 0x00);		/* ID 0 */
 	checkword = retbyte << 8;
-	retbyte = i2c_read(dev, 0x01);		/* ID 1 */
+	retbyte = i2c_read(gspca_dev, 0x01);		/* ID 1 */
 	checkword |= retbyte;
 	PDEBUG(D_PROBE, "probe 3wr vga 2 0x%04x", checkword);
 	if (checkword == 0x2030) {
-		retbyte = i2c_read(dev, 0x02);	/* revision number */
+		retbyte = i2c_read(gspca_dev, 0x02);	/* revision number */
 		PDEBUG(D_PROBE, "sensor PO2030 rev 0x%02x", retbyte);
 		send_unknown(dev, SENSOR_PO2030);
 		return checkword;
@@ -6925,7 +6928,7 @@
 	reg_w(dev, 0x01, 0x12);
 	reg_w(dev, 0x05, 0x01);
 	reg_w(dev, 0xd3, 0x8b);
-	retbyte = i2c_read(dev, 0x01);
+	retbyte = i2c_read(gspca_dev, 0x01);
 	if (retbyte != 0) {
 		PDEBUG(D_PROBE, "probe 3wr vga type 0a ?");
 		return 0x0a;			/* ?? */
@@ -6936,7 +6939,6 @@
 static int zcxx_probeSensor(struct gspca_dev *gspca_dev)
 {
 	struct sd *sd = (struct sd *) gspca_dev;
-	struct usb_device *dev = gspca_dev->dev;
 	int sensor, sensor2;
 
 	switch (sd->sensor) {
@@ -6944,7 +6946,7 @@
 	case SENSOR_TAS5130C_VF0250:
 		return -1;		/* don't probe */
 	}
-	sensor = vga_2wr_probe(dev);
+	sensor = vga_2wr_probe(gspca_dev);
 	if (sensor >= 0) {
 		if (sensor < 0x7600)
 			return sensor;
@@ -6956,7 +6958,7 @@
 			return sensor;
 		return sensor2;
 	}
-	return sif_probe(dev);
+	return sif_probe(gspca_dev);
 }
 
 /* this function is called at probe time */
@@ -6966,7 +6968,6 @@
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct cam *cam;
 	int sensor;
-	__u8 bsensor;
 	int vga = 1;		/* 1: vga, 0: sif */
 	static const __u8 gamma[SENSOR_MAX] = {
 		5,	/* SENSOR_CS2102 0 */
@@ -7122,7 +7123,7 @@
 			reg_w(gspca_dev->dev, 0x02, 0x0010);
 		else
 			reg_w(gspca_dev->dev, sensor & 0x0f, 0x0010);
-		reg_r(gspca_dev->dev, 0x0010, &bsensor);
+		reg_r(gspca_dev, 0x0010);
 	}
 
 	cam = &gspca_dev->cam;
@@ -7163,7 +7164,6 @@
 	struct usb_device *dev = gspca_dev->dev;
 	const struct usb_action *zc3_init;
 	int mode;
-	__u8 retbyte;
 	static const struct usb_action *init_tb[SENSOR_MAX][2] = {
 		{cs2102_InitialScale, cs2102_Initial},		/* 0 */
 		{cs2102K_InitialScale, cs2102K_Initial},	/* 1 */
@@ -7194,7 +7194,7 @@
 		zcxx_probeSensor(gspca_dev);
 		break;
 	case SENSOR_PAS106:
-		usb_exchange(dev, pas106b_Initial_com);
+		usb_exchange(gspca_dev, pas106b_Initial_com);
 		break;
 	case SENSOR_PB0330:
 		if (mode) {
@@ -7210,14 +7210,14 @@
 		}
 		break;
 	}
-	usb_exchange(dev, zc3_init);
+	usb_exchange(gspca_dev, zc3_init);
 
 	switch (sd->sensor) {
 	case SENSOR_GC0305:
 	case SENSOR_OV7620:
 	case SENSOR_PO2030:
 		msleep(100);			/* ?? */
-		reg_r(dev, 0x0002, &retbyte);	/* --> 0x40 */
+		reg_r(gspca_dev, 0x0002);	/* --> 0x40 */
 		reg_w(dev, 0x09, 0x01ad);	/* (from win traces) */
 		reg_w(dev, 0x15, 0x01ae);
 		reg_w(dev, 0x0d, 0x003a);
@@ -7230,11 +7230,11 @@
 	setbrightness(gspca_dev);
 	switch (sd->sensor) {
 	case SENSOR_OV7620:
-		reg_r(dev, 0x0008, &retbyte);
+		reg_r(gspca_dev, 0x0008);
 		reg_w(dev, 0x00, 0x0008);
 		break;
 	case SENSOR_GC0305:
-		reg_r(dev, 0x0008, &retbyte);
+		reg_r(gspca_dev, 0x0008);
 		/* fall thru */
 	case SENSOR_PO2030:
 		reg_w(dev, 0x03, 0x0008);
@@ -7259,7 +7259,7 @@
 	setmatrix(gspca_dev);			/* one more time? */
 	switch (sd->sensor) {
 	case SENSOR_OV7620:
-		reg_r(dev, 0x0180, &retbyte);	/* from win */
+		reg_r(gspca_dev, 0x0180);	/* from win */
 		reg_w(dev, 0x00, 0x0180);
 		break;
 	default:
@@ -7277,7 +7277,7 @@
 		break;
 	case SENSOR_PO2030:
 		reg_w(dev, 0x40, 0x0117);	/* (from win traces) */
-		reg_r(dev, 0x0180, &retbyte);
+		reg_r(gspca_dev, 0x0180);
 		break;
 	}
 
@@ -7289,22 +7289,23 @@
 		reg_w(dev, 0x15, 0x01ae);
 		reg_w(dev, 0x40, 0x0180);
 		reg_w(dev, 0x40, 0x0117);
-		reg_r(dev, 0x0180, &retbyte);
+		reg_r(gspca_dev, 0x0180);
 		sd->autogain = 1;
 		setautogain(gspca_dev);
 		break;
 	case SENSOR_OV7620:
-		i2c_read(dev, 0x13);		/*fixme: returns 0xa3 */
-		i2c_write(dev, 0x13, 0xa3, 0x00); /*fixme: same to send? */
+		i2c_read(gspca_dev, 0x13);	/*fixme: returns 0xa3 */
+		i2c_write(gspca_dev, 0x13, 0xa3, 0x00);
+					 /*fixme: returned value to send? */
 		reg_w(dev, 0x40, 0x0117);	/* (from win traces) */
-		reg_r(dev, 0x0180, &retbyte);
+		reg_r(gspca_dev, 0x0180);
 		setautogain(gspca_dev);
 		msleep(500);
 		break;
 	case SENSOR_PO2030:
 		msleep(500);
-		reg_r(dev, 0x0008, &retbyte);
-		reg_r(dev, 0x0007, &retbyte);
+		reg_r(gspca_dev, 0x0008);
+		reg_r(gspca_dev, 0x0007);
 		reg_w(dev, 0x00, 0x0007);	/* (from win traces) */
 		reg_w(dev, 0x02, 0x0008);
 		break;
