mfd: Remove unneeded io_mutex from struct twl6040
authorAxel Lin <axel.lin@gmail.com>
Wed, 11 Jul 2012 02:06:34 +0000 (10:06 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 16 Jul 2012 13:27:09 +0000 (15:27 +0200)
Current code has been converted to use regmap APIs, the io_mutex is not needed.
Thus remove the io_mutex.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/twl6040-core.c
include/linux/mfd/twl6040.h

index 4ded9e7aa246efdc0e38347fab044f46ef2dc7ef..5f620ae3b1f970c27c8fa1232e7b11ca63e0b776 100644 (file)
@@ -64,19 +64,15 @@ int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
        int ret;
        unsigned int val;
 
-       mutex_lock(&twl6040->io_mutex);
        /* Vibra control registers from cache */
        if (unlikely(reg == TWL6040_REG_VIBCTLL ||
                     reg == TWL6040_REG_VIBCTLR)) {
                val = twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)];
        } else {
                ret = regmap_read(twl6040->regmap, reg, &val);
-               if (ret < 0) {
-                       mutex_unlock(&twl6040->io_mutex);
+               if (ret < 0)
                        return ret;
-               }
        }
-       mutex_unlock(&twl6040->io_mutex);
 
        return val;
 }
@@ -86,12 +82,10 @@ int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val)
 {
        int ret;
 
-       mutex_lock(&twl6040->io_mutex);
        ret = regmap_write(twl6040->regmap, reg, val);
        /* Cache the vibra control registers */
        if (reg == TWL6040_REG_VIBCTLL || reg == TWL6040_REG_VIBCTLR)
                twl6040->vibra_ctrl_cache[VIBRACTRL_MEMBER(reg)] = val;
-       mutex_unlock(&twl6040->io_mutex);
 
        return ret;
 }
@@ -99,23 +93,13 @@ EXPORT_SYMBOL(twl6040_reg_write);
 
 int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
 {
-       int ret;
-
-       mutex_lock(&twl6040->io_mutex);
-       ret = regmap_update_bits(twl6040->regmap, reg, mask, mask);
-       mutex_unlock(&twl6040->io_mutex);
-       return ret;
+       return regmap_update_bits(twl6040->regmap, reg, mask, mask);
 }
 EXPORT_SYMBOL(twl6040_set_bits);
 
 int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
 {
-       int ret;
-
-       mutex_lock(&twl6040->io_mutex);
-       ret = regmap_update_bits(twl6040->regmap, reg, mask, 0);
-       mutex_unlock(&twl6040->io_mutex);
-       return ret;
+       return regmap_update_bits(twl6040->regmap, reg, mask, 0);
 }
 EXPORT_SYMBOL(twl6040_clear_bits);
 
@@ -573,7 +557,6 @@ static int __devinit twl6040_probe(struct i2c_client *client,
        twl6040->irq = client->irq;
 
        mutex_init(&twl6040->mutex);
-       mutex_init(&twl6040->io_mutex);
        init_completion(&twl6040->ready);
 
        twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
index 6659487c31e7a010c96bcef991f05b546fa103d1..dcc0e12b803847237006ba6bc408dacc50196508 100644 (file)
@@ -206,7 +206,6 @@ struct twl6040 {
        struct regmap *regmap;
        struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */
        struct mutex mutex;
-       struct mutex io_mutex;
        struct mutex irq_mutex;
        struct mfd_cell cells[TWL6040_CELLS];
        struct completion ready;
This page took 0.04526 seconds and 5 git commands to generate.