summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2012-05-17 02:28:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 08:24:56 -0700
commit4fd4d7d8de0ade3da10f9d08506dca5b4ddf1245 (patch)
treec39f6d4f75446526dc030ab5049ef882923174ea /drivers/staging
parent4906a15c037f423b711ed2927836568264761927 (diff)
staging: iio: reorganize hmc5843_set_rate()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/iio/magnetometer/hmc5843.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
index 9216b07a855d..32f19b7493d9 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843.c
@@ -343,12 +343,13 @@ static s32 hmc5843_set_rate(struct i2c_client *client,
struct hmc5843_data *data = iio_priv(indio_dev);
u8 reg_val;
- reg_val = (data->meas_conf) | (rate << HMC5843_RATE_OFFSET);
if (rate >= HMC5843_RATE_NOT_USED) {
dev_err(&client->dev,
"data output rate is not supported\n");
return -EINVAL;
}
+
+ reg_val = data->meas_conf | (rate << HMC5843_RATE_OFFSET);
return i2c_smbus_write_byte_data(client, HMC5843_CONFIG_REG_A, reg_val);
}