diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-06-04 04:26:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 13:06:08 -0400 |
commit | 9a731a3265a808c806766a28e2b62e9da78f9ac6 (patch) | |
tree | c7e6465a5233a6e0579f81d46f0de80a8213ce49 /drivers/media/video/gspca/spca500.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/spca500.c')
-rw-r--r-- | drivers/media/video/gspca/spca500.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c index b866c73c97db..c02beb6c1e93 100644 --- a/drivers/media/video/gspca/spca500.c +++ b/drivers/media/video/gspca/spca500.c | |||
@@ -57,7 +57,7 @@ struct sd { | |||
57 | #define PalmPixDC85 13 | 57 | #define PalmPixDC85 13 |
58 | #define ToptroIndus 14 | 58 | #define ToptroIndus 14 |
59 | 59 | ||
60 | u8 *jpeg_hdr; | 60 | u8 jpeg_hdr[JPEG_HDR_SZ]; |
61 | }; | 61 | }; |
62 | 62 | ||
63 | /* V4L2 controls supported by the driver */ | 63 | /* V4L2 controls supported by the driver */ |
@@ -669,9 +669,6 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
669 | __u8 xmult, ymult; | 669 | __u8 xmult, ymult; |
670 | 670 | ||
671 | /* create the JPEG header */ | 671 | /* create the JPEG header */ |
672 | sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); | ||
673 | if (!sd->jpeg_hdr) | ||
674 | return -ENOMEM; | ||
675 | jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, | 672 | jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, |
676 | 0x22); /* JPEG 411 */ | 673 | 0x22); /* JPEG 411 */ |
677 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); | 674 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); |
@@ -891,13 +888,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
891 | gspca_dev->usb_buf[0]); | 888 | gspca_dev->usb_buf[0]); |
892 | } | 889 | } |
893 | 890 | ||
894 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
895 | { | ||
896 | struct sd *sd = (struct sd *) gspca_dev; | ||
897 | |||
898 | kfree(sd->jpeg_hdr); | ||
899 | } | ||
900 | |||
901 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 891 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
902 | u8 *data, /* isoc packet */ | 892 | u8 *data, /* isoc packet */ |
903 | int len) /* iso packet length */ | 893 | int len) /* iso packet length */ |
@@ -1055,7 +1045,6 @@ static const struct sd_desc sd_desc = { | |||
1055 | .init = sd_init, | 1045 | .init = sd_init, |
1056 | .start = sd_start, | 1046 | .start = sd_start, |
1057 | .stopN = sd_stopN, | 1047 | .stopN = sd_stopN, |
1058 | .stop0 = sd_stop0, | ||
1059 | .pkt_scan = sd_pkt_scan, | 1048 | .pkt_scan = sd_pkt_scan, |
1060 | .get_jcomp = sd_get_jcomp, | 1049 | .get_jcomp = sd_get_jcomp, |
1061 | .set_jcomp = sd_set_jcomp, | 1050 | .set_jcomp = sd_set_jcomp, |