]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: revise locking for pcf50633 ADC
authorPaul Fertser <fercerpav@gmail.com>
Mon, 27 Jul 2009 20:58:48 +0000 (00:58 +0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 17 Sep 2009 07:46:53 +0000 (09:46 +0200)
commit04a1aafb9d7cbe2706983bd3df0d0ba740796704
treef88c4992b1473ff5b72dc5d0b97522bf964363d4
parenta6d6f0ac38f3656a5536f040ea5070fc59ad9d0d
mfd: revise locking for pcf50633 ADC

Current implementation is prone to races, this patch attempts to remove all
but one (in pcf50633_adc_sync_read).

The idea is that we need to guard the queue access only on inserting and
removing items. If we insert and there're no more items in the queue it
means that the last irq already happened and we need to trigger ADC
manually. If not, then the next conversion will be triggered by the irq
handler upon completion of the previous.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/pcf50633-adc.c