linux/drivers/staging/lirc
Andy Walls 9b28500a59 [media] lirc_zilog: Remove broken, ineffective reference counting
The set_use_inc() and set_use_dec() functions tried to lock
the underlying bridge driver device instance in memory by
changing the use count on the device's i2c_clients.  This
worked for PCI devices (ivtv, cx18, bttv).  It doesn't
work for hot-pluggable usb devices (pvrusb2 and hdpvr).
With usb device instances, the driver may get locked into
memory, but the unplugged hardware is gone.

The set_use_inc() set_use_dec() functions also tried to have
lirc_zilog change its own module refernce count, which is
racy and not guaranteed to work.  The lirc_dev module does
actually perform proper module ref count manipulation on the
lirc_zilog module, so there is need for lirc_zilog to
attempt a buggy module get on itself anyway.

lirc_zilog also errantly called these functions on itself
in open() and close(), but lirc_dev did that already too.

So let's just gut the bodies of the set_use_*() functions,
and remove the extra calls to them from within lirc_zilog.

Proper reference counting of the struct IR, IR_rx, and IR_tx
objects -- to handle the case when the underlying
bttv, ivtv, cx18, hdpvr, or pvrusb2 bridge driver module or
device instance goes away -- will be added in subsequent
patches.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2011-03-22 19:23:50 -03:00
..
Kconfig [media] lirc: remove staging lirc_it87 and lirc_ite8709 drivers 2011-03-22 17:20:13 -03:00
lirc_bt829.c V4L/DVB: staging/lirc: CodingStyle cleanups 2010-08-02 16:43:35 -03:00
lirc_ene0100.h V4L/DVB: staging/lirc: add lirc_ene0100 driver 2010-08-02 16:43:21 -03:00
lirc_igorplugusb.c [media] lirc_igorplugusb: add Fit PC2 device ID 2010-10-22 20:05:37 -02:00
lirc_imon.c [media] staging/lirc: fix mem leaks and ptr err usage 2011-01-19 12:52:22 -02:00
lirc_parallel.c [media] staging/lirc: fix mem leaks and ptr err usage 2011-01-19 12:52:22 -02:00
lirc_parallel.h V4L/DVB: staging/lirc: add lirc_parallel driver 2010-08-02 16:43:27 -03:00
lirc_sasem.c [media] staging/lirc: fix mem leaks and ptr err usage 2011-01-19 12:52:22 -02:00
lirc_serial.c [media] staging/lirc: fix mem leaks and ptr err usage 2011-01-19 12:52:22 -02:00
lirc_sir.c [media] staging/lirc: fix mem leaks and ptr err usage 2011-01-19 12:52:22 -02:00
lirc_ttusbir.c V4L/DVB: staging/lirc: CodingStyle cleanups 2010-08-02 16:43:35 -03:00
lirc_zilog.c [media] lirc_zilog: Remove broken, ineffective reference counting 2011-03-22 19:23:50 -03:00
Makefile [media] lirc: remove staging lirc_it87 and lirc_ite8709 drivers 2011-03-22 17:20:13 -03:00
TODO V4L/DVB: staging/lirc: wire up Kconfig and Makefile bits 2010-08-02 16:43:34 -03:00
TODO.lirc_zilog [media] lirc_zilog: Update TODO.lirc_zilog 2011-01-19 11:46:11 -02:00