From 46ef041ead9ce757fd2b10a81932b85ce8200b4b Mon Sep 17 00:00:00 2001 From: Kai Jauslin Date: Sat, 4 Apr 2015 09:49:32 +0200 Subject: [PATCH 1/4] Updated gspca.c from kernel sources 3.4.29 --- gspca.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/gspca.c b/gspca.c index 4268a73..2ddd254 100644 --- a/gspca.c +++ b/gspca.c @@ -20,11 +20,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* - * WARNING: THIS IS A PATCHED VERION OF alt_xfer(), - * WICH RETURNS THE SECOND ISOC ENDPOINT, NOT THE FIRST! -*/ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt @@ -610,13 +605,12 @@ static void gspca_stream_off(struct gspca_dev *gspca_dev) /* * look for an input transfer endpoint in an alternate setting - * patched to get _only_ the second endpoint */ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, int xfer) { struct usb_host_endpoint *ep; - int i, attr, ep_nr; + int i, attr,ep_nr; ep_nr=0; for (i = 0; i < alt->desc.bNumEndpoints; i++) { @@ -624,13 +618,10 @@ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, attr = ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; if (attr == xfer && ep->desc.wMaxPacketSize != 0 - && usb_endpoint_dir_in(&ep->desc)){ - if(ep_nr > 0){ - - return ep; - } - else - ep_nr++; + && usb_endpoint_dir_in(&ep->desc)) { + if (ep_nr > 0) { + return ep; + } else ep_nr++; } } return NULL; @@ -1279,6 +1270,7 @@ static void gspca_release(struct v4l2_device *v4l2_device) static int dev_open(struct file *file) { struct gspca_dev *gspca_dev = video_drvdata(file); + int ret; PDEBUG(D_STREAM, "[%s] open", current->comm); @@ -1286,7 +1278,10 @@ static int dev_open(struct file *file) if (!try_module_get(gspca_dev->module)) return -ENODEV; - return v4l2_fh_open(file); + ret = v4l2_fh_open(file); + if (ret) + module_put(gspca_dev->module); + return ret; } static int dev_close(struct file *file) From f7a38a402a55de08dd5b03f2e901073b895c13c5 Mon Sep 17 00:00:00 2001 From: Kai Jauslin Date: Sat, 4 Apr 2015 09:53:10 +0200 Subject: [PATCH 2/4] Switched to hard float build --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5083dd4..0c53ce5 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,9 @@ ifeq ($(UNAME),armv6l) AMRKDIR := /usr/src/linux else ARCH := arm - CROSS := arm-linux-gnueabi- - ARMKDIR := /usr/src/arm/linux + CROSS := arm-linux-gnueabihf- + #ARMKDIR := ~/pi/linux + ARMKDIR := /usr/src/arm/linux endif default: From f41917b01bfa7cabf3089ce55dd3c068052beae7 Mon Sep 17 00:00:00 2001 From: Kai Jauslin Date: Sat, 4 Apr 2015 10:00:21 +0200 Subject: [PATCH 3/4] Formatting cleanup --- Makefile | 1 - gspca.c | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0c53ce5..3d999bf 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ ifeq ($(UNAME),armv6l) else ARCH := arm CROSS := arm-linux-gnueabihf- - #ARMKDIR := ~/pi/linux ARMKDIR := /usr/src/arm/linux endif diff --git a/gspca.c b/gspca.c index 2ddd254..066b0aa 100644 --- a/gspca.c +++ b/gspca.c @@ -610,7 +610,7 @@ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, int xfer) { struct usb_host_endpoint *ep; - int i, attr,ep_nr; + int i, attr, ep_nr; ep_nr=0; for (i = 0; i < alt->desc.bNumEndpoints; i++) { @@ -621,7 +621,9 @@ static struct usb_host_endpoint *alt_xfer(struct usb_host_interface *alt, && usb_endpoint_dir_in(&ep->desc)) { if (ep_nr > 0) { return ep; - } else ep_nr++; + } else { + ep_nr++; + } } } return NULL; From 6c9d697ffc3447fb4d14f511cdf13f8aae70f113 Mon Sep 17 00:00:00 2001 From: Kai Jauslin Date: Sat, 4 Apr 2015 10:01:37 +0200 Subject: [PATCH 4/4] Formatting cleanup --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d999bf..02e49da 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ ifeq ($(UNAME),armv6l) else ARCH := arm CROSS := arm-linux-gnueabihf- - ARMKDIR := /usr/src/arm/linux + ARMKDIR := /usr/src/arm/linux endif default: