[PATCH] power:ds2782 use swapped varient of i2c_smbus_read_word_data

From: Jonathan Cameron
Date: Fri Oct 21 2011 - 06:08:16 EST


Relies on: i2c: boilerplate function for byte swapped smbus_write/read_word_data

Ensures the error isn't mangled as a side effect.

Signed-off-by: Jonathan Cameron <jic23@xxxxxxxxx>
---
Note the patch introducing this fucntion is working its way through
the i2c tree.

drivers/power/ds2782_battery.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/power/ds2782_battery.c b/drivers/power/ds2782_battery.c
index bfbce5d..a616954 100644
--- a/drivers/power/ds2782_battery.c
+++ b/drivers/power/ds2782_battery.c
@@ -17,7 +17,6 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
-#include <linux/swab.h>
#include <linux/i2c.h>
#include <linux/idr.h>
#include <linux/power_supply.h>
@@ -80,7 +79,7 @@ static inline int ds278x_read_reg16(struct ds278x_info *info, int reg_msb,
{
int ret;

- ret = swab16(i2c_smbus_read_word_data(info->client, reg_msb));
+ ret = i2c_smbus_read_word_data_swapped(info->client, reg_msb);
if (ret < 0) {
dev_err(&info->client->dev, "register read failed\n");
return ret;
--
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/