From 59929cefa5f573178df3c4abfb36d55f7b33f214 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Fran=C3=A7ois=20Moine?= Date: Mon, 14 Mar 2011 05:33:01 -0300 Subject: [PATCH] [media] gspca - main: Cleanup source MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - change copyright and erroneous comment - small code optimization - have constant the device template Signed-off-by: Jean-François Moine Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/gspca/gspca.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c index f21f2a2..6288174 100644 --- a/drivers/media/video/gspca/gspca.c +++ b/drivers/media/video/gspca/gspca.c @@ -1,7 +1,7 @@ /* * Main USB camera driver * - * Copyright (C) 2008-2010 Jean-François Moine + * Copyright (C) 2008-2011 Jean-François Moine * * Camera button input handling by Márton Németh * Copyright (C) 2009-2010 Márton Németh @@ -414,7 +414,6 @@ resubmit: * - 0 or many INTER_PACKETs * - one LAST_PACKET * DISCARD_PACKET invalidates the whole frame. - * On LAST_PACKET, a new frame is returned. */ void gspca_frame_add(struct gspca_dev *gspca_dev, enum gspca_packet_type packet_type, @@ -1525,10 +1524,12 @@ static int vidioc_reqbufs(struct file *file, void *priv, gspca_dev->usb_err = 0; gspca_stream_off(gspca_dev); mutex_unlock(&gspca_dev->usb_lock); + + /* Don't restart the stream when switching from read + * to mmap mode */ + if (gspca_dev->memory == GSPCA_MEMORY_READ) + streaming = 0; } - /* Don't restart the stream when switching from read to mmap mode */ - if (gspca_dev->memory == GSPCA_MEMORY_READ) - streaming = 0; /* free the previous allocated buffers, if any */ if (gspca_dev->nframes != 0) @@ -2152,7 +2153,7 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = { .vidioc_g_chip_ident = vidioc_g_chip_ident, }; -static struct video_device gspca_template = { +static const struct video_device gspca_template = { .name = "gspca main driver", .fops = &dev_fops, .ioctl_ops = &dev_ioctl_ops, -- 2.7.4