diff options
Diffstat (limited to 'drivers/iio/trigger/iio-trig-loop.c')
| -rw-r--r-- | drivers/iio/trigger/iio-trig-loop.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/iio/trigger/iio-trig-loop.c b/drivers/iio/trigger/iio-trig-loop.c index dc6be28f96fe..7aaed0611899 100644 --- a/drivers/iio/trigger/iio-trig-loop.c +++ b/drivers/iio/trigger/iio-trig-loop.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2016 Jonathan Cameron <jic23@kernel.org> * - * Licensed under the GPL-2. - * * Based on a mashup of the hrtimer trigger and continuous sampling proposal of * Gregor Boirie <gregor.boirie@parrot.com> * @@ -36,7 +35,7 @@ struct iio_loop_info { struct task_struct *task; }; -static struct config_item_type iio_loop_type = { +static const struct config_item_type iio_loop_type = { .ct_owner = THIS_MODULE, }; @@ -47,7 +46,7 @@ static int iio_loop_thread(void *data) set_freezable(); do { - iio_trigger_poll_chained(trig); + iio_trigger_poll_nested(trig); } while (likely(!kthread_freezable_should_stop(NULL))); return 0; @@ -60,7 +59,7 @@ static int iio_loop_trigger_set_state(struct iio_trigger *trig, bool state) if (state) { loop_trig->task = kthread_run(iio_loop_thread, trig, trig->name); - if (unlikely(IS_ERR(loop_trig->task))) { + if (IS_ERR(loop_trig->task)) { dev_err(&trig->dev, "failed to create trigger loop thread\n"); return PTR_ERR(loop_trig->task); @@ -74,7 +73,6 @@ static int iio_loop_trigger_set_state(struct iio_trigger *trig, bool state) static const struct iio_trigger_ops iio_loop_trigger_ops = { .set_trigger_state = iio_loop_trigger_set_state, - .owner = THIS_MODULE, }; static struct iio_sw_trigger *iio_trig_loop_probe(const char *name) @@ -86,7 +84,7 @@ static struct iio_sw_trigger *iio_trig_loop_probe(const char *name) if (!trig_info) return ERR_PTR(-ENOMEM); - trig_info->swt.trigger = iio_trigger_alloc("%s", name); + trig_info->swt.trigger = iio_trigger_alloc(NULL, "%s", name); if (!trig_info->swt.trigger) { ret = -ENOMEM; goto err_free_trig_info; |
