--- initial
+++ final
@@ -1,90 +1,90 @@
 static void cx11646_jpeg(struct gspca_dev *gspca_dev) {
   int i;
   int length;
   __u8 Reg55;
   int retry;
   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[gspca_dev->curr_mode].priv) {
   case 0:
     for (i = 0; i < 27; i++) {
       if (i == 26) length = 2;
       reg_w(gspca_dev, 0x0008, cxjpeg_640[i], length);
     }
     Reg55 = 0x28;
     break;
   case 1:
     for (i = 0; i < 27; i++) {
       if (i == 26) length = 2;
       reg_w(gspca_dev, 0x0008, cxjpeg_352[i], length);
     }
     Reg55 = 0x16;
     break;
   default:
     /*	case 2: */
     for (i = 0; i < 27; i++) {
       if (i == 26) length = 2;
       reg_w(gspca_dev, 0x0008, cxjpeg_320[i], length);
     }
     Reg55 = 0x14;
     break;
   case 3:
     for (i = 0; i < 27; i++) {
       if (i == 26) length = 2;
       reg_w(gspca_dev, 0x0008, cxjpeg_176[i], length);
     }
     Reg55 = 0x0B;
     break;
   }
   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;
   do {
     reg_r(gspca_dev, 0x0002, 1);
     /* 0x07 until 0x00 */
     if (gspca_dev->usb_buf[0] == 0x00) break;
     reg_w_val(gspca_dev, 0x0053, 0x00);
   } while (--retry);
-  if (retry == 0) PERR("Damned Errors sending jpeg Table");
+  if (retry == 0) gspca_err(gspca_dev, "Damned Errors sending jpeg Table\n");
   /* send the qtable now */
   reg_r(gspca_dev, 0x0001, 1); /* -> 0x18 */
   length = 8;
   for (i = 0; i < 18; i++) {
     if (i == 17) length = 2;
     reg_w(gspca_dev, 0x0008, cxjpeg_qtable[i], length);
   }
   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, 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, 0x0051, reg51, 2);
   reg_w(gspca_dev, 0x0010, reg10, 2);
   reg_w_val(gspca_dev, 0x0070, reg70);
 }<sep>@@
if String.length c < 3 || not(String.sub c (String.length c - 3) 2 = "\\n")
then c1 := make_expr ((String.sub c 0 (String.length c - 1)) ^ "\\n\"")
else c1 := make_expr c

@@
symbol gspca_dev;
constant char[] r.c;
expression s.c1;
@@
-               PERR(c
+               gspca_err(gspca_dev,c1
		,...)