diff options
author | Irina Tirdea <irina.tirdea@intel.com> | 2015-07-23 19:15:02 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-08-02 19:19:57 +0200 |
commit | 5ab744d0d6e7fc90572250239ac796cd79b0ed77 (patch) | |
tree | ca3a9265603b9b7628561ff873eaea47dfda2ff0 | |
parent | iio: magn: bmc150_magn: add locking comment for runtime resume (diff) | |
download | linux-5ab744d0d6e7fc90572250239ac796cd79b0ed77.tar.xz linux-5ab744d0d6e7fc90572250239ac796cd79b0ed77.zip |
iio: magn: bmc150_magn: do not set power state twice when setting trigger state
When setting the trigger state, the device power state is set through
buffer preenable and postdisable hooks. There is no need
to also set it in the trigger set state call.
Remove duplicate set power state from the trigger set
state call.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/magnetometer/bmc150_magn.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index 57f21fe10dd7..bf47c8838b49 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -784,29 +784,23 @@ static int bmc150_magn_data_rdy_trigger_set_state(struct iio_trigger *trig, if (state == data->dready_trigger_on) goto err_unlock; - ret = bmc150_magn_set_power_state(data, state); - if (ret < 0) - goto err_unlock; - ret = regmap_update_bits(data->regmap, BMC150_MAGN_REG_INT_DRDY, BMC150_MAGN_MASK_DRDY_EN, state << BMC150_MAGN_SHIFT_DRDY_EN); if (ret < 0) - goto err_poweroff; + goto err_unlock; data->dready_trigger_on = state; if (state) { ret = bmc150_magn_reset_intr(data); if (ret < 0) - goto err_poweroff; + goto err_unlock; } mutex_unlock(&data->mutex); return 0; -err_poweroff: - bmc150_magn_set_power_state(data, false); err_unlock: mutex_unlock(&data->mutex); return ret; |