diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-06-04 05:26:42 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 14:06:08 -0300 |
commit | 9a731a3265a808c806766a28e2b62e9da78f9ac6 (patch) | |
tree | c7e6465a5233a6e0579f81d46f0de80a8213ce49 /drivers/media/video/gspca/stk014.c | |
parent | 456c9acb63fa5c3974c72309f831bd0e1f34b6d9 (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/stk014.c')
-rw-r--r-- | drivers/media/video/gspca/stk014.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 0fb534210a2..45f4bc6ffc4 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c @@ -40,7 +40,7 @@ struct sd { #define QUALITY_MAX 95 #define QUALITY_DEF 80 - u8 *jpeg_hdr; + u8 jpeg_hdr[JPEG_HDR_SZ]; }; /* V4L2 controls supported by the driver */ @@ -337,9 +337,6 @@ static int sd_start(struct gspca_dev *gspca_dev) int ret, value; /* create the JPEG header */ - sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); - if (!sd->jpeg_hdr) - return -ENOMEM; jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, 0x22); /* JPEG 411 */ jpeg_set_qual(sd->jpeg_hdr, sd->quality); @@ -412,13 +409,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) PDEBUG(D_STREAM, "camera stopped"); } -static void sd_stop0(struct gspca_dev *gspca_dev) -{ - struct sd *sd = (struct sd *) gspca_dev; - - kfree(sd->jpeg_hdr); -} - static void sd_pkt_scan(struct gspca_dev *gspca_dev, u8 *data, /* isoc packet */ int len) /* iso packet length */ @@ -578,7 +568,6 @@ static const struct sd_desc sd_desc = { .init = sd_init, .start = sd_start, .stopN = sd_stopN, - .stop0 = sd_stop0, .pkt_scan = sd_pkt_scan, .querymenu = sd_querymenu, .get_jcomp = sd_get_jcomp, |