summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/bt8xx/bttvp.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-01-28 16:32:59 -0800
committerTrent Piepho <xyzzy@speakeasy.org>2009-01-28 16:32:59 -0800
commite2b4212172d81f17f5e4741766f032d06e83ce4f (patch)
tree8866c98448f14044b38b4885536b8b846c91574e /linux/drivers/media/video/bt8xx/bttvp.h
parentc945cec9c8d31064b500e0dff54cd4b3b7ec5136 (diff)
downloadmediapointer-dvb-s2-e2b4212172d81f17f5e4741766f032d06e83ce4f.tar.gz
mediapointer-dvb-s2-e2b4212172d81f17f5e4741766f032d06e83ce4f.tar.bz2
bttv: dynamically allocate device data
From: Trent Piepho <xyzzy@speakeasy.org> The bttv driver had static array of structures for up to 16 possible bttv devices, even though few users have more than one or two. The structures were quite large and this resulted in a huge BSS segment. Change the driver to allocate the bttv device data dynamically, which changes "struct bttv bttvs[BTTV_MAX]" to "struct bttv *bttvs[BTTV_MAX]". It would be nice to get ride of "bttvs" entirely but there are some complications with gpio access from the audio & mpeg drivers. To help bttvs removal along anyway, I changed the open() methods use the video device's drvdata to get the driver data instead of looking it up in the bttvs array. This is also more efficient. Some WARN_ON()s are added in cases the device node exists by the bttv device doesn't, which I don't think should be possible. The gpio access functions need to check if bttvs[card] is NULL now. Though calling them on a non-existent card in the first place is wrong, but hard to solve given the fundamental problems in how the gpio access code works. This patch reduces the bss size by 66560 bytes on ia32. Overall change is a reduction of 66398 bytes, as the WARN_ON()s add some 198 bytes. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/bt8xx/bttvp.h')
-rw-r--r--linux/drivers/media/video/bt8xx/bttvp.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/drivers/media/video/bt8xx/bttvp.h b/linux/drivers/media/video/bt8xx/bttvp.h
index b5eaf03ae..20b1ad68a 100644
--- a/linux/drivers/media/video/bt8xx/bttvp.h
+++ b/linux/drivers/media/video/bt8xx/bttvp.h
@@ -464,7 +464,7 @@ struct bttv {
/* our devices */
#define BTTV_MAX 32
extern unsigned int bttv_num;
-extern struct bttv bttvs[BTTV_MAX];
+extern struct bttv *bttvs[BTTV_MAX];
static inline unsigned int bttv_muxsel(const struct bttv *btv,
unsigned int input)