mfd: revise locking for pcf50633 ADC
commitbd8ef10261d7ae92ad2b4925afd2b56f46175c47
authorPaul Fertser <fercerpav@gmail.com>
Mon, 27 Jul 2009 20:58:48 +0000 (28 00:58 +0400)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 17 Sep 2009 07:46:53 +0000 (17 09:46 +0200)
treef88c4992b1473ff5b72dc5d0b97522bf964363d4
parented52e62ebec9e703eb0b69704feaf1b6e847d882
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