Skip to content

Commit

Permalink
mfd: Don't use mutex_lock_interruptible in ab8500-core
Browse files Browse the repository at this point in the history
This disadvantage of having it interruptible is that it would
appear to work OK in most situations, but in the rare case
that this call does fail, it can lead to misconfiguration
of the AB, such as a regulator not being turned off and
leading to a platform power consumption increase.

There's no real benefit to having this interruptible.

Make it a plain mutex_lock. The non-interruptability matches
other low-level I/O functions such as SPI and I2C.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Rabin Vincent authored and Samuel Ortiz committed Mar 16, 2012
1 parent bd155d2 commit 392cbd1
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/mfd/ab8500-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ static int set_register_interruptible(struct ab8500 *ab8500, u8 bank,

dev_vdbg(ab8500->dev, "wr: addr %#x <= %#x\n", addr, data);

ret = mutex_lock_interruptible(&ab8500->lock);
if (ret)
return ret;
mutex_lock(&ab8500->lock);

ret = ab8500->write(ab8500, addr, data);
if (ret < 0)
Expand All @@ -176,9 +174,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank,
* bank on higher 8 bits and reg in lower */
u16 addr = ((u16)bank) << 8 | reg;

ret = mutex_lock_interruptible(&ab8500->lock);
if (ret)
return ret;
mutex_lock(&ab8500->lock);

ret = ab8500->read(ab8500, addr);
if (ret < 0)
Expand Down Expand Up @@ -210,9 +206,7 @@ static int mask_and_set_register_interruptible(struct ab8500 *ab8500, u8 bank,
* bank on higher 8 bits and reg in lower */
u16 addr = ((u16)bank) << 8 | reg;

ret = mutex_lock_interruptible(&ab8500->lock);
if (ret)
return ret;
mutex_lock(&ab8500->lock);

ret = ab8500->read(ab8500, addr);
if (ret < 0) {
Expand Down

0 comments on commit 392cbd1

Please sign in to comment.