diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-11-13 09:28:45 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-21 16:08:00 +0100 |
commit | 14591d888e35c12b15eccf54e490c7769eb6d6d2 (patch) | |
tree | 16631920135867d55fbdace5073cd89b61446c72 /drivers/mfd/twl-core.c | |
parent | 2473d25a2f61985f8980c7c3d41cb85da1abea0f (diff) |
mfd/rtc/gpio: twl: No need to allocate bigger buffer for write
Since the twl-core has been converted to use regmap it is no longer needed
to allocate bigger buffer for data when writing to twl.
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/twl-core.c')
-rw-r--r-- | drivers/mfd/twl-core.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 5043f505a230..a55ab15ecf1a 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -344,7 +344,7 @@ int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes) twl = &twl_modules[sid]; ret = regmap_bulk_write(twl->regmap, twl_map[mod_no].base + reg, - &value[1], num_bytes); + value, num_bytes); if (ret) pr_err("%s: Write failed (mod %d, reg 0x%02x count %d)\n", @@ -406,12 +406,7 @@ EXPORT_SYMBOL(twl_i2c_read); */ int twl_i2c_write_u8(u8 mod_no, u8 value, u8 reg) { - - /* 2 bytes offset 1 contains the data offset 0 is used by i2c_write */ - u8 temp_buffer[2] = { 0 }; - /* offset 1 contains the data */ - temp_buffer[1] = value; - return twl_i2c_write(mod_no, temp_buffer, reg, 1); + return twl_i2c_write(mod_no, &value, reg, 1); } EXPORT_SYMBOL(twl_i2c_write_u8); |