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/sunplus.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/sunplus.c')
-rw-r--r-- | drivers/media/video/gspca/sunplus.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index 0c786e00ebcf..21d82bab0c2e 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -54,7 +54,7 @@ struct sd { | |||
54 | #define MegapixV4 4 | 54 | #define MegapixV4 4 |
55 | #define MegaImageVI 5 | 55 | #define MegaImageVI 5 |
56 | 56 | ||
57 | u8 *jpeg_hdr; | 57 | u8 jpeg_hdr[JPEG_HDR_SZ]; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* V4L2 controls supported by the driver */ | 60 | /* V4L2 controls supported by the driver */ |
@@ -842,9 +842,6 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
842 | int enable; | 842 | int enable; |
843 | 843 | ||
844 | /* create the JPEG header */ | 844 | /* create the JPEG header */ |
845 | sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL); | ||
846 | if (!sd->jpeg_hdr) | ||
847 | return -ENOMEM; | ||
848 | jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, | 845 | jpeg_define(sd->jpeg_hdr, gspca_dev->height, gspca_dev->width, |
849 | 0x22); /* JPEG 411 */ | 846 | 0x22); /* JPEG 411 */ |
850 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); | 847 | jpeg_set_qual(sd->jpeg_hdr, sd->quality); |
@@ -954,13 +951,6 @@ static void sd_stopN(struct gspca_dev *gspca_dev) | |||
954 | } | 951 | } |
955 | } | 952 | } |
956 | 953 | ||
957 | static void sd_stop0(struct gspca_dev *gspca_dev) | ||
958 | { | ||
959 | struct sd *sd = (struct sd *) gspca_dev; | ||
960 | |||
961 | kfree(sd->jpeg_hdr); | ||
962 | } | ||
963 | |||
964 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, | 954 | static void sd_pkt_scan(struct gspca_dev *gspca_dev, |
965 | u8 *data, /* isoc packet */ | 955 | u8 *data, /* isoc packet */ |
966 | int len) /* iso packet length */ | 956 | int len) /* iso packet length */ |
@@ -1162,7 +1152,6 @@ static const struct sd_desc sd_desc = { | |||
1162 | .init = sd_init, | 1152 | .init = sd_init, |
1163 | .start = sd_start, | 1153 | .start = sd_start, |
1164 | .stopN = sd_stopN, | 1154 | .stopN = sd_stopN, |
1165 | .stop0 = sd_stop0, | ||
1166 | .pkt_scan = sd_pkt_scan, | 1155 | .pkt_scan = sd_pkt_scan, |
1167 | .get_jcomp = sd_get_jcomp, | 1156 | .get_jcomp = sd_get_jcomp, |
1168 | .set_jcomp = sd_set_jcomp, | 1157 | .set_jcomp = sd_set_jcomp, |