Use kthread_create_worker() helper to simplify the code. It uses the kthread worker API the right way. It will eventually allow to remove the FIXME in kthread_worker_fn() and add more consistency checks in the future.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -358,8 +358,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) · 357 unmodified lines | ||
| 358 | 358 | * @cleanup: frees controller-specific state |
| 359 | 359 | * @can_dma: determine whether this controller supports DMA |
| 360 | 360 | * @queued: whether this controller is providing an internal message queue |
| 361 | − * @kworker: thread struct for message pump | |
| 362 | − * @kworker_task: pointer to task for message pump kworker thread | |
| 361 | + * @kworker: pointer to thread struct for message pump | |
| 363 | 362 | * @pump_messages: work struct for scheduling work to the message pump |
| 364 | 363 | * @queue_lock: spinlock to syncronise access to message queue |
| 365 | 364 | * @queue: message queue |
| @@ -593,8 +592,7 @@ struct spi_controller { · 227 unmodified lines | ||
| 593 | 592 | * Over time we expect SPI drivers to be phased over to this API. |
| 594 | 593 | */ |
| 595 | 594 | bool queued; |
| 596 | − struct kthread_worker kworker; | |
| 597 | − struct task_struct *kworker_task; | |
| 595 | + struct kthread_worker *kworker; | |
| 598 | 596 | struct kthread_work pump_messages; |
| 599 | 597 | spinlock_t queue_lock; |
| 600 | 598 | struct list_head queue; |