Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ ifeq ($(UNAME),armv6l)
AMRKDIR := /usr/src/linux
else
ARCH := arm
CROSS := arm-linux-gnueabi-
ARMKDIR := /usr/src/arm/linux
CROSS := arm-linux-gnueabihf-
ARMKDIR := /usr/src/arm/linux
endif

default:
Expand Down
25 changes: 11 additions & 14 deletions gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -610,7 +605,6 @@ 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)
Expand All @@ -624,13 +618,12 @@ 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;
Expand Down Expand Up @@ -1279,14 +1272,18 @@ 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);

/* protect the subdriver against rmmod */
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)
Expand Down