7 Jul
2015
7 Jul
'15
3:55 p.m.
On Tue, Jun 30, 2015 at 03:30:41PM +0800, Nicolas Boichat wrote:
rt5645_jack_detect_work (the workqueue called by rt5645_irq), needs to access rt5645->codec. However, this field is only initialized in rt5645_probe. This can obviously lead to kernel panics.
Fix that by moving the irq request from rt5645_i2c_probe to rt5645_probe. Also, fail if the IRQ cannot be requested, and move irq_free from rt5645_i2c_remove to rt5645_remove.
No, this is broken - we want to be requesting resources in the device level probe since it integrates better with things like deferred probing. You need to fix the interrupt handler to cope without the CODEC.