Skip to content

Commit

Permalink
iio: adc: ina2xx: Make use of the helper macro kthread_run()
Browse files Browse the repository at this point in the history
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Reviewed-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Cai Huoqing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
caihuoqing1990 authored and jic23 committed Nov 17, 2021
1 parent dc19fa6 commit 4bdc3e9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/iio/adc/ina2xx-adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4bdc3e9

Please sign in to comment.