android_kernel_xiaomi_sm8350/drivers/media/video/cx88
Trent Piepho 081c2fc8b9 V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs
It was a struct cx8802_driver for no apparent reason.  Nothing uses a
cx8802_driver in the cx8802_dev struct.  The only field that was used was
devlist, a list_head.

The code in cx8802_remove() that removed any loaded sub-drivers was broken.
It would delete the current list entry, but didn't use list_for_each_safe.  It
also called list_del() on the list _head_ inside the list_for_each loop?  It
would crash if it was run, which I don't think can ever happen.

Since the cx8802 sub-drivers use the cx8802 driver, they have to be unloaded
first.  So there isn't any way for a sub-driver to still be loaded when
cx8802_remove() is called...  Except maybe with PCI hot-plug, if one removes
the PCI card while the drivers are loaded?

So I left some code in to handle that if it's actually possible.  It will
remove the sub-drivers from the device cx8802_remove() was called on, and only
that device.  If one has two DVB cards and unplugs one, there is no reason to
unload the DVB drivers for both cards.  I have no way to test this, but it
can't be worse than what was there before.

cx8802_get_driver() is passed a cx8802_dev pointer and looks for the requested
driver on that device.  It first loops over the cx8802 device list looking for
the device it was passed, which is pointless.  It doesn't need to find the
device pointer in the list, as it already has the pointer.

The list_head in the cx8802_driver struct, which joins all the _drivers_
attached to a device, was named devlist.  Changed that to drvlist, since the
devlist is used for a list of _devices_ in other cx8802 structs.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-22 12:01:43 -02:00
..
cx88-alsa.c V4L/DVB (6187): cx88-alsa: Add TLV support 2007-10-22 12:01:18 -02:00
cx88-blackbird.c V4L/DVB (6321): Remove obsolete VIDIOC_S/G_MPEGCOMP ioctls 2007-10-22 12:01:30 -02:00
cx88-cards.c V4L/DVB (6064): cx88: Add symbolic names for the PCI interrupt bits 2007-10-09 22:05:54 -03:00
cx88-core.c V4L/DVB (6312): cx88: Replace list_for_each+list_entry with list_for_each_entry 2007-10-10 13:34:48 -03:00
cx88-dvb.c V4L/DVB (6333): cx88: Change void* card_priv to struct vp3054_i2c_state 2007-10-22 12:01:42 -02:00
cx88-i2c.c V4L/DVB (6283): videobuf: Remove references to old Kconfig option name 2007-10-10 00:03:08 -03:00
cx88-input.c V4L/DVB (6247): Fix bug #8689: Fixes IR stop/start during suspend/resume 2007-10-09 22:14:51 -03:00
cx88-mpeg.c V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs 2007-10-22 12:01:43 -02:00
cx88-reg.h V4L/DVB (6066): cx88-alsa: Change order of interrupt enabling, fix spurious IRQs 2007-10-09 22:05:55 -03:00
cx88-tvaudio.c V4L/DVB (6125): whitespace cleanup: replace leading spaces with tabs 2007-10-09 22:07:29 -03:00
cx88-vbi.c V4L/DVB (6312): cx88: Replace list_for_each+list_entry with list_for_each_entry 2007-10-10 13:34:48 -03:00
cx88-video.c V4L/DVB (6320): v4l core: remove the unused .hardware V4L1 field 2007-10-22 12:01:24 -02:00
cx88-vp3054-i2c.c V4L/DVB (6333): cx88: Change void* card_priv to struct vp3054_i2c_state 2007-10-22 12:01:42 -02:00
cx88-vp3054-i2c.h V4L/DVB (5629): Cx88: VP3054 support can't be a module when cx88 is compiled in 2007-07-18 14:23:11 -03:00
cx88.h V4L/DVB (6334): cx88: Change (struct cx8802_dev)->drvlist to a list_head and fix bugs 2007-10-22 12:01:43 -02:00
Kconfig V4L/DVB (6260): Fix Kconfig dependency 2007-10-10 00:02:49 -03:00
Makefile