[media] lirc_zilog: Extensive rework of ir_probe()/ir_remove()
authorAndy Walls <awalls@md.metrocast.net>
Sat, 15 Jan 2011 04:04:06 +0000 (01:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 Jan 2011 13:46:06 +0000 (11:46 -0200)
commita68a9b73fbb05144a71b573f262fbc8ed8f71179
treea1fffd97eecbc39244bd21ee47dca6063e8ad5c8
parente9b351f64f5c02acf6552d2109bc213bfa133388
[media] lirc_zilog: Extensive rework of ir_probe()/ir_remove()

This patch is an extensive rework of the ir_probe() and ir_remove() functions.

It removes all the double binding and allocation problems on module load.

It removes almost all the memory leaks on module exit and on device
instantiation failure. Proper destruction of the Rx polling kthread still
needs investigation and more work, but it is no worse than it already was.

This rework also had side effects that include:

- encapsulation of the ir_devices[] array
- serialization of access to the ir_devices[] array
- semantic change of the module parameter "disable_rx" to "tx_only"

If tx_only is true, the module does not claim the i2c_client for the IR Rx
function, and only claims and handles the i2c_client for the IR Tx function.
This is a first step in providing the option of letting ir-kbd-i2c.c handle
IR Rx function, while lirc_zilog handles the IR Tx function.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/lirc/lirc_zilog.c