aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/mars.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-06-04 04:26:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 13:06:08 -0400
commit9a731a3265a808c806766a28e2b62e9da78f9ac6 (patch)
treec7e6465a5233a6e0579f81d46f0de80a8213ce49 /drivers/media/video/gspca/mars.c
parent456c9acb63fa5c3974c72309f831bd0e1f34b6d9 (diff)
V4L/DVB: gspca - JPEG subdrivers: Don't allocate the JPEG header
The JPEG header is now included in the subdriver structure instead of being allocated and freed at capture start and stop. Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/mars.c')
-rw-r--r--drivers/media/video/gspca/mars.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c
index 3d9229e22b25..031f7195ce0d 100644
--- a/drivers/media/video/gspca/mars.c
+++ b/drivers/media/video/gspca/mars.c
@@ -41,7 +41,7 @@ struct sd {
41#define QUALITY_MAX 70 41#define QUALITY_MAX 70
42#define QUALITY_DEF 50 42#define QUALITY_DEF 50
43 43
44 u8 *jpeg_hdr; 44 u8 jpeg_hdr[JPEG_HDR_SZ];
45}; 45};
46 46
47/* V4L2 controls supported by the driver */ 47/* V4L2 controls supported by the driver */
@@ -200,9 +200,6 @@ static int sd_start(struct gspca_dev *gspca_dev)
200 int i; 200 int i;
201 201
202 /* create the JPEG header */ 202 /* create the JPEG header */
203 sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
204 if (!sd->jpeg_hdr)
205 return -ENOMEM;
206 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 203 jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width,
207 0x21); /* JPEG 422 */ 204 0x21); /* JPEG 422 */
208 jpeg_set_qual(sd->jpeg_hdr, sd->quality); 205 jpeg_set_qual(sd->jpeg_hdr, sd->quality);
@@ -317,13 +314,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev)
317 PDEBUG(D_ERR, "Camera Stop failed"); 314 PDEBUG(D_ERR, "Camera Stop failed");
318} 315}
319 316
320static void sd_stop0(struct gspca_dev *gspca_dev)
321{
322 struct sd *sd = (struct sd *) gspca_dev;
323
324 kfree(sd->jpeg_hdr);
325}
326
327static void sd_pkt_scan(struct gspca_dev *gspca_dev, 317static void sd_pkt_scan(struct gspca_dev *gspca_dev,
328 u8 *data, /* isoc packet */ 318 u8 *data, /* isoc packet */
329 int len) /* iso packet length */ 319 int len) /* iso packet length */
@@ -486,7 +476,6 @@ static const struct sd_desc sd_desc = {
486 .init = sd_init, 476 .init = sd_init,
487 .start = sd_start, 477 .start = sd_start,
488 .stopN = sd_stopN, 478 .stopN = sd_stopN,
489 .stop0 = sd_stop0,
490 .pkt_scan = sd_pkt_scan, 479 .pkt_scan = sd_pkt_scan,
491 .get_jcomp = sd_get_jcomp, 480 .get_jcomp = sd_get_jcomp,
492 .set_jcomp = sd_set_jcomp, 481 .set_jcomp = sd_set_jcomp,