[ARM] locomo: fix unpaired spin_lock_irqsave
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 22 Mar 2010 03:09:20 +0000 (11:09 +0800)
committerEric Miao <eric.y.miao@gmail.com>
Mon, 22 Mar 2010 04:03:09 +0000 (12:03 +0800)
commitc8c3dcb9df8025ed48f8b14bf4b8a77801d88758
tree42a62d5218a6edb26efa8a21eabfe5973dcb03ae
parent1b0d76cb9d5a65567230097a2512046f09f30523
[ARM] locomo: fix unpaired spin_lock_irqsave

The function locomo_m62332_senddata sends a three byte i2c message to
a M62332 DAC. This entire function is guarded with a spin_lock_irqsave
at the start of the function and a spin_unlock_irqrestore at the end.

As each byte is transferred, the i2c ACK from the DAC is checked.
Currently, if the ACK is missing the function simply returns without
the unlock. It also leaves the i2c bus in an invalid state since the
last byte transferred did not have a "stop" condition and leave the
bus idle.

Fix this by adding an exit path using goto.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
arch/arm/common/locomo.c
This page took 0.025232 seconds and 5 git commands to generate.