Commit 4bdc3e96 authored by Cai Huoqing's avatar Cai Huoqing Committed by Jonathan Cameron

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20211021124254.3247-1-caihuoqing@baidu.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent dc19fa63
...@@ -842,15 +842,14 @@ static int ina2xx_buffer_enable(struct iio_dev *indio_dev) ...@@ -842,15 +842,14 @@ static int ina2xx_buffer_enable(struct iio_dev *indio_dev)
dev_dbg(&indio_dev->dev, "Async readout mode: %d\n", dev_dbg(&indio_dev->dev, "Async readout mode: %d\n",
chip->allow_async_readout); chip->allow_async_readout);
task = kthread_create(ina2xx_capture_thread, (void *)indio_dev, task = kthread_run(ina2xx_capture_thread, (void *)indio_dev,
"%s:%d-%uus", indio_dev->name, "%s:%d-%uus", indio_dev->name,
iio_device_id(indio_dev), iio_device_id(indio_dev),
sampling_us); sampling_us);
if (IS_ERR(task)) if (IS_ERR(task))
return PTR_ERR(task); return PTR_ERR(task);
get_task_struct(task); get_task_struct(task);
wake_up_process(task);
chip->task = task; chip->task = task;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment