Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1191146 > unrolled thread
| Started by | Irina Tirdea <irina.tirdea@intel.com> |
|---|---|
| First post | 2015-07-23 19:20 +0200 |
| Last post | 2015-08-02 19:30 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/2] iio: magn: bmc150_magn: do not set power state twice when setting trigger state Irina Tirdea <irina.tirdea@intel.com> - 2015-07-23 19:20 +0200
Re: [PATCH 2/2] iio: magn: bmc150_magn: do not set power state twice when setting trigger state Jonathan Cameron <jic23@kernel.org> - 2015-08-02 19:30 +0200
| From | Irina Tirdea <irina.tirdea@intel.com> |
|---|---|
| Date | 2015-07-23 19:20 +0200 |
| Subject | [PATCH 2/2] iio: magn: bmc150_magn: do not set power state twice when setting trigger state |
| Message-ID | <pPsk1-4Kr-17@gated-at.bofh.it> |
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>
---
drivers/iio/magnetometer/bmc150_magn.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
index d66f8cf..38c2eb64 100644
--- a/drivers/iio/magnetometer/bmc150_magn.c
+++ b/drivers/iio/magnetometer/bmc150_magn.c
@@ -783,29 +783,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;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2015-08-02 19:30 +0200 |
| Subject | Re: [PATCH 2/2] iio: magn: bmc150_magn: do not set power state twice when setting trigger state |
| Message-ID | <pT5fb-2f1-3@gated-at.bofh.it> |
| In reply to | #1191146 |
On 23/07/15 18:15, Irina Tirdea wrote:
> 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>
Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/magnetometer/bmc150_magn.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
> index d66f8cf..38c2eb64 100644
> --- a/drivers/iio/magnetometer/bmc150_magn.c
> +++ b/drivers/iio/magnetometer/bmc150_magn.c
> @@ -783,29 +783,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;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web