6 May
2011
6 May
'11
2:53 p.m.
On Fri, May 06, 2011 at 01:46:34PM +0800, Lu Guanqun wrote:
- if (interrupt_status & 0x1 && value == 0x1)
status |= SND_JACK_HEADSET;
- if (interrupt_status & 0x2 && value == 0x2)
status |= SND_JACK_HEADPHONE;
- if (interrupt_status & 0x4)
status |= SND_JACK_HEADSET | SND_JACK_BTN_0;
- if (interrupt_status & 0x8)
status |= SND_JACK_HEADSET | SND_JACK_BTN_1;
It's very strange that you do a mix of checks with and without the == - it doesn't matter either way but it'd be clearer to be consistent.
- if (upd9976->irq < 0 || !upd9976->irq_mem)
return 0;
It'd seem better to have this condition the other way around so if you need to add more conditional stuff things will be clearer.