[media] lirc_zilog: Add ref counting of struct IR, IR_tx, and IR_rx
authorAndy Walls <awalls@md.metrocast.net>
Tue, 8 Feb 2011 01:30:55 +0000 (22:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 22:23:59 +0000 (19:23 -0300)
commit5bd6b0464b68d429bc8a3fe6595d19c39dfc4d95
tree884f301574395cf271eee6972925c5425a69f906
parent534c1eab1e2770dca3cf4616cc4059683020114b
[media] lirc_zilog: Add ref counting of struct IR, IR_tx, and IR_rx

This is a major change to add pointer reference counting for
struct IR, struct IR_tx, and struct IR_rx object instances.
This ref counting gets lirc_zilog closer to gracefully handling
bridge drivers and hot-unplugged USB devices disappearing out from
under lirc_zilog when the /dev/lircN node is still open.  (mutexes
to protect the i2c_client pointers in struct IR_tx and struct IR_rx
still need to be added.)

This reference counting also helps lirc_zilog clean up properly
when the i2c_clients disappear.

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>
drivers/staging/lirc/lirc_zilog.c