summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorCai Huoqing <caihuoqing@baidu.com>2021-10-21 14:42:53 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-11-17 18:51:34 +0100
commit4bdc3e967dc6c22e32da0ddba099828415ac4b0e (patch)
tree44ed449970d7f56936f135a13399a7331891fd93 /drivers/iio
parentiio: ms5611: Simplify IO callback parameters (diff)
downloadlinux-4bdc3e967dc6c22e32da0ddba099828415ac4b0e.tar.xz
linux-4bdc3e967dc6c22e32da0ddba099828415ac4b0e.zip
iio: adc: ina2xx: Make use of the helper macro kthread_run()
Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Link: https://lore.kernel.org/r/20211021124254.3247-1-caihuoqing@baidu.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/ina2xx-adc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c
index a4b2ff9e0dd5..360d7a00f60d 100644
--- a/drivers/iio/adc/ina2xx-adc.c
+++ b/drivers/iio/adc/ina2xx-adc.c
@@ -842,15 +842,14 @@ static int ina2xx_buffer_enable(struct iio_dev *indio_dev)
dev_dbg(&indio_dev->dev, "Async readout mode: %d\n",
chip->allow_async_readout);
- task = kthread_create(ina2xx_capture_thread, (void *)indio_dev,
- "%s:%d-%uus", indio_dev->name,
- iio_device_id(indio_dev),
- sampling_us);
+ task = kthread_run(ina2xx_capture_thread, (void *)indio_dev,
+ "%s:%d-%uus", indio_dev->name,
+ iio_device_id(indio_dev),
+ sampling_us);
if (IS_ERR(task))
return PTR_ERR(task);
get_task_struct(task);
- wake_up_process(task);
chip->task = task;
return 0;