diff options
Diffstat (limited to 'drivers/staging/iio/gyro/adis16260_trigger.c')
-rw-r--r-- | drivers/staging/iio/gyro/adis16260_trigger.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_trigger.c b/drivers/staging/iio/gyro/adis16260_trigger.c index 4f10fb5..01094d0 100644 --- a/drivers/staging/iio/gyro/adis16260_trigger.c +++ b/drivers/staging/iio/gyro/adis16260_trigger.c @@ -18,8 +18,7 @@ static int adis16260_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { - struct adis16260_state *st = trig->private_data; - struct iio_dev *indio_dev = st->indio_dev; + struct iio_dev *indio_dev = trig->private_data; dev_dbg(&indio_dev->dev, "%s (%d)\n", __func__, state); return adis16260_set_irq(indio_dev, state); @@ -28,7 +27,7 @@ static int adis16260_data_rdy_trigger_set_state(struct iio_trigger *trig, int adis16260_probe_trigger(struct iio_dev *indio_dev) { int ret; - struct adis16260_state *st = indio_dev->dev_data; + struct adis16260_state *st = iio_priv(indio_dev); st->trig = iio_allocate_trigger("%s-dev%d", spi_get_device_id(st->us)->name, @@ -48,7 +47,7 @@ int adis16260_probe_trigger(struct iio_dev *indio_dev) st->trig->dev.parent = &st->us->dev; st->trig->owner = THIS_MODULE; - st->trig->private_data = st; + st->trig->private_data = indio_dev; st->trig->set_trigger_state = &adis16260_data_rdy_trigger_set_state; ret = iio_trigger_register(st->trig); @@ -69,9 +68,9 @@ error_ret: void adis16260_remove_trigger(struct iio_dev *indio_dev) { - struct adis16260_state *state = indio_dev->dev_data; + struct adis16260_state *st = iio_priv(indio_dev); - iio_trigger_unregister(state->trig); - free_irq(state->us->irq, state->trig); - iio_free_trigger(state->trig); + iio_trigger_unregister(st->trig); + free_irq(st->us->irq, st->trig); + iio_free_trigger(st->trig); } |