linux-kernel-test/drivers
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
..
accessibility
acpi Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
amba amba: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:22 -07:00
ata Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
atm
auxdisplay
base Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k 2009-03-26 16:15:31 -07:00
bluetooth
cdrom
char Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
clocksource Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
connector
cpufreq Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq 2009-03-26 11:04:08 -07:00
cpuidle
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2009-03-26 11:04:34 -07:00
dca
dio dio: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:22 -07:00
dma Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
edac edac: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:21 -07:00
eisa Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
firewire
firmware
gpio gpio: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:23 -07:00
gpu Merge branch 'linus' into percpu-cpumask-x86-for-linus-2 2009-03-28 04:26:01 +01:00
hid Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2009-03-26 16:14:02 -07:00
hwmon
i2c Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2009-03-28 14:04:53 -07:00
ide Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2009-03-26 11:17:04 -07:00
idle
ieee1394 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2009-03-27 18:33:56 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-03-28 13:30:43 -07:00
input Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
isdn Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-03-26 15:23:24 -07:00
leds
lguest Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
macintosh
mca mca: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:23 -07:00
md
media V4L/DVB (10568): bttv: dynamically allocate device data 2009-03-30 12:42:47 -03:00
memstick
message
mfd mfd: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:23 -07:00
misc Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6 2009-03-28 14:04:53 -07:00
mmc Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
mtd Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
net Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
nubus
of
oprofile
parisc
parport
pci Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
pcmcia Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
platform Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6 2009-03-26 16:14:02 -07:00
pnp
power
ps3
rapidio rapidio: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:21 -07:00
regulator
rtc Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-03-28 13:30:43 -07:00
sbus
scsi Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
serial Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
sh maple: fix Error in kernel-doc notation 2009-03-29 08:12:39 -07:00
sn
spi Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
ssb b43: Add BCM4307 PCI-ID 2009-03-27 20:13:20 -04:00
staging
tc tc: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:22 -07:00
telephony
thermal
uio UIO: Take offset into account when determining number of pages that can be mapped 2009-03-24 16:38:25 -07:00
usb Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
uwb
video Merge branch 'origin' into devel 2009-03-28 20:29:51 +00:00
virtio
w1 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel 2009-03-25 18:31:35 +00:00
watchdog Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2009-03-28 14:03:14 -07:00
xen
zorro zorro: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:21 -07:00
Kconfig
Makefile ide/net: flip the order of SATA and network init 2009-03-28 13:06:16 -07:00