linux/drivers/media/video
Trent Piepho 4b10d3b626 V4L/DVB (10568): bttv: dynamically allocate device data
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.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-30 12:42:47 -03:00
..
au0828
bt8xx V4L/DVB (10568): bttv: dynamically allocate device data 2009-03-30 12:42:47 -03:00
cpia2 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
cx18 V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
cx88 V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
cx23885 V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
cx25840 V4L/DVB (10408): v4l2: fix incorrect hue range check 2009-03-30 12:42:35 -03:00
em28xx V4L/DVB (10556): em28xx-cards: Add Pinnacle Dazzle Video Creator Plus DVC107 description 2009-03-30 12:42:46 -03:00
et61x251 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
gspca V4L/DVB (10432): gspca - vc032x: Cleanup source, optimize and check i2c_write. 2009-03-30 12:42:37 -03:00
ivtv V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
ovcamchip i2c: Drop I2C_CLASS_CAM_DIGITAL 2009-01-07 14:29:17 +01:00
pvrusb2 V4L/DVB (10303): pvrusb2: Use usb_make_path() to determine device bus location 2009-03-30 12:42:26 -03:00
pwc V4L/DVB (10242): pwc: add support for webcam snapshot button 2009-03-30 12:42:22 -03:00
saa7134 V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
sn9c102 V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
usbvideo V4L/DVB (10185): Use negated usb_endpoint_xfer_control, etc 2009-01-07 22:18:56 -02:00
usbvision V4L/DVB (10306): usbvision: use usb_make_path to report bus info 2009-03-30 12:42:27 -03:00
uvc V4L/DVB (10308): uvcvideo: use usb_make_path to report bus info 2009-03-30 12:42:27 -03:00
zc0301 V4L/DVB (10343): gspca - zc3xx / zc0301: Handle the 0ac8:303b instead of zc0301. 2009-03-30 12:42:30 -03:00
zoran V4L/DVB (10834): zoran: auto-select bt866 for AverMedia 6 Eyes 2009-03-05 20:33:37 -03:00
adv7170.c
adv7175.c
arv.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
bt819.c
bt856.c
bt866.c
btcx-risc.c
btcx-risc.h
bw-qcam.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
bw-qcam.h
c-qcam.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
cafe_ccic-regs.h
cafe_ccic.c i2c: Drop I2C_CLASS_CAM_DIGITAL 2009-01-07 14:29:17 +01:00
cpia.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
cpia.h
cpia_pp.c
cpia_usb.c
cs53l32a.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
cs5345.c V4L/DVB (10193): removed unused #include <version.h>'s 2009-01-29 08:35:36 -02:00
cs8420.h
cx2341x.c V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
dabusb.c V4L/DVB (10298): remove err macro from few usb devices 2009-03-30 12:42:26 -03:00
dabusb.h
font.h
hexium_gemini.c V4L/DVB (10271): saa7146: convert to video_ioctl2. 2009-03-30 12:42:24 -03:00
hexium_orion.c V4L/DVB (10271): saa7146: convert to video_ioctl2. 2009-03-30 12:42:24 -03:00
ibmmpeg2.h
indycam.c
indycam.h
ir-kbd-i2c.c V4L/DVB (9521): V4L: struct device - replace bus_id with dev_name(), dev_set_name() 2008-12-29 17:53:26 -02:00
Kconfig V4L/DVB (10099): soc-camera: add support for MT9T031 CMOS camera sensor from Micron 2008-12-30 09:40:30 -02:00
ks0127.c
ks0127.h
m52790.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
Makefile V4L/DVB (10137): v4l2-compat32: only build if needed 2009-01-02 17:11:25 -02:00
meye.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
meye.h
msp3400-driver.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
msp3400-driver.h V4L/DVB (9825): msp3400: convert to v4l2_subdev. 2008-12-30 09:38:39 -02:00
msp3400-kthreads.c V4L/DVB (9825): msp3400: convert to v4l2_subdev. 2008-12-30 09:38:39 -02:00
mt9m001.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
mt9m111.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
mt9t031.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
mt9v022.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
mxb.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
mxb.h
omap24xxcam-dma.c V4L/DVB (9815): omap2: add OMAP2 camera driver. 2008-12-30 09:38:35 -02:00
omap24xxcam.c [ARM] omap: omap24xxcam: use short connection IDs for omap2 clocks 2009-02-08 17:50:22 +00:00
omap24xxcam.h V4L/DVB (9815): omap2: add OMAP2 camera driver. 2008-12-30 09:38:35 -02:00
ov511.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
ov511.h
ov772x.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
ov7670.c i2c: Drop I2C_CLASS_CAM_DIGITAL 2009-01-07 14:29:17 +01:00
pms.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
pxa_camera.c Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel 2009-03-13 21:44:51 +00:00
s2255drv.c V4L/DVB (10309): s2255drv: use usb_make_path to report bus info 2009-03-30 12:42:27 -03:00
saa711x_regs.h
saa717x.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
saa5246a.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
saa5249.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
saa6588.c V4L/DVB (10539): saa6588: remove legacy_class, not needed for saa6588 2009-03-30 12:42:45 -03:00
saa7110.c
saa7111.c
saa7114.c
saa7115.c V4L/DVB (10408): v4l2: fix incorrect hue range check 2009-03-30 12:42:35 -03:00
saa7121.h
saa7127.c V4L/DVB (10216): saa7127: fix broken S-Video with saa7129 2009-01-29 08:35:38 -02:00
saa7146.h
saa7146reg.h
saa7185.c
saa7191.c
saa7191.h
se401.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
se401.h
sh_mobile_ceu_camera.c V4L/DVB (10663): soc-camera: fix S_CROP breakage on PXA and SuperH 2009-02-26 22:29:18 -03:00
soc_camera.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
soc_camera_platform.c V4L/DVB (10080): soc-camera: readability improvements, more strict operations checks 2008-12-30 09:40:21 -02:00
stk-sensor.c
stk-webcam.c V4L/DVB (10135): v4l2: introduce v4l2_file_operations. 2009-01-02 17:11:12 -02:00
stk-webcam.h
stradis.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
stv680.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
stv680.h
tcm825x.c
tcm825x.h
tda7432.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
tda9840.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
tda9875.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
tea6415c.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
tea6415c.h V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
tea6420.c V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
tea6420.h V4L/DVB (10499): saa7146: convert saa7146 and mxb in particular to v4l2_subdev. 2009-03-30 12:42:42 -03:00
tlv320aic23b.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
tuner-core.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
tvaudio.c V4L/DVB (10832): tvaudio: Avoid breakage with tda9874a 2009-03-05 20:33:37 -03:00
tveeprom.c V4L/DVB (10416): tveeprom: update to include Hauppauge tuners 151-155 2009-03-30 12:42:36 -03:00
tvp514x.c V4L/DVB (10202): [PATCH] v4l/tvp514x: Don't write after line end 2009-01-29 08:35:37 -02:00
tvp514x_regs.h V4L/DVB (9817): v4l: add new tvp514x I2C video decoder driver 2008-12-30 09:38:36 -02:00
tvp5150.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
tvp5150_reg.h
tw9910.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
upd64031a.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
upd64083.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
v4l1-compat.c poll: allow f_op->poll to sleep 2009-01-06 15:59:12 -08:00
v4l2-common.c V4L/DVB (10544): v4l2-common: add comments warning that about the sort order 2009-03-30 12:42:46 -03:00
v4l2-compat-ioctl32.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
v4l2-dev.c V4L/DVB (10139): v4l: rename v4l_compat_ioctl32 to v4l2_compat_ioctl32 2009-01-02 17:11:39 -02:00
v4l2-device.c v4l: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:22 -07:00
v4l2-int-device.c
v4l2-ioctl.c V4L/DVB (10490): v4l2: prefill ident and revision from v4l2_dbg_chip_ident. 2009-03-30 12:42:41 -03:00
v4l2-subdev.c V4L/DVB (10542): v4l2-subdev: add querystd and g_input_status 2009-03-30 12:42:46 -03:00
videobuf-core.c
videobuf-dma-contig.c V4L/DVB (10304): buf-dma-contig: fix USERPTR free handling 2009-03-30 12:42:27 -03:00
videobuf-dma-sg.c V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpage 2009-01-07 22:18:54 -02:00
videobuf-dvb.c
videobuf-vmalloc.c V4L/DVB (10305): videobuf-vmalloc: Fix: videobuf memory were never freed 2009-03-30 12:42:27 -03:00
vino.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
vino.h
vivi.c V4L/DVB (10211): vivi: Implements 4 inputs on vivi 2009-03-30 12:42:20 -03:00
vp27smpx.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
vpx3220.c
w9966.c V4L/DVB (10138): v4l2-ioctl: change to long return type to match unlocked_ioctl. 2009-01-02 17:11:34 -02:00
w9968cf.c i2c: Drop I2C_CLASS_CAM_DIGITAL 2009-01-07 14:29:17 +01:00
w9968cf.h
w9968cf_decoder.h
w9968cf_vpp.h
wm8739.c V4L/DVB (10409): v4l: remove unused I2C_DRIVERIDs. 2009-03-30 12:42:36 -03:00
wm8775.c V4L/DVB (10141): v4l2: debugging API changed to match against driver name instead of ID. 2009-01-02 17:11:52 -02:00
zr364xx.c V4L/DVB (10263): zr364xx: add support for Aiptek DV T300 2009-03-30 12:42:23 -03:00