[cpia] patch to fix debug/usb.h problems..

Thomas Davis tadavis@lbl.gov
Tue, 14 Mar 2000 11:09:22 -0800


This is a multi-part message in MIME format.
--------------9F04D76AF2AE76E9CAB72B23
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I've attached a patch to fix two problems;

1) removing -DDEBUG from the makefile, causes the compile to die.  (two
lines are goofy)
	
2) Fixes the usb.h based on kernel version.

-- 
------------------------+--------------------------------------------------
Thomas Davis		| PDSF Project Leader
tadavis@lbl.gov		| 
(510) 486-4524		| "Only a petabyte of data this year?"
--------------9F04D76AF2AE76E9CAB72B23
Content-Type: text/plain; charset=us-ascii;
 name="cpia-0.7.4.diff"
Content-Disposition: inline;
 filename="cpia-0.7.4.diff"
Content-Transfer-Encoding: 7bit

diff -ruN cpia-0.7.4/module/cpia.c cpia-0.7.4-fixed/module/cpia.c
--- cpia-0.7.4/module/cpia.c	Sat Mar 11 13:44:01 2000
+++ cpia-0.7.4-fixed/module/cpia.c	Mon Mar 13 19:27:46 2000
@@ -1647,9 +1647,9 @@
 	cmd[7] = 0;
 
 	retval = cam->ops->transferCmd(cam->lowlevel_data, cmd, data);
-	if (retval)
+	if (retval) {
 		DBG("%x - failed, retval=%d\n", command, retval);
-	else {
+	} else {
 		switch(command) {
 		case CPIA_COMMAND_GetCPIAVersion:
 			cam->params.version.firmwareVersion = data[0];
@@ -2251,9 +2251,9 @@
 			schedule();
 
 		cam->image_size = parse_picture(cam, image_size);
-		if (cam->image_size <= 0)
+		if (cam->image_size <= 0) {
 			DBG("parse_picture failed %d\n", cam->image_size);
-		else
+		} else
 			break;
 	}
 
diff -ruN cpia-0.7.4/module/cpia_usb.c cpia-0.7.4-fixed/module/cpia_usb.c
--- cpia-0.7.4/module/cpia_usb.c	Sat Mar 11 13:44:01 2000
+++ cpia-0.7.4-fixed/module/cpia_usb.c	Tue Mar 14 11:11:40 2000
@@ -31,7 +31,11 @@
 #include <linux/vmalloc.h>
 
 #include "cpia.h"
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,51))
+#include <linux/usb.h>
+#else
 #include "/usr/src/linux/drivers/usb/usb.h"
+#endif
 
 #define USB_REQ_CPIA_GRAB_FRAME			0xC1
 #define USB_REQ_CPIA_UPLOAD_FRAME		0xC2

--------------9F04D76AF2AE76E9CAB72B23--