struct txx9spi {
- struct workqueue_struct *workqueue;
struct work_struct work;
spinlock_t lock; /* protect 'queue' */
struct list_head queue;
spin_lock_irqsave(&c->lock, flags);
list_add_tail(&m->queue, &c->queue);
- queue_work(c->workqueue, &c->work);
+ schedule_work(&c->work);
spin_unlock_irqrestore(&c->lock, flags);
return 0;
if (ret)
goto exit;
- c->workqueue = create_singlethread_workqueue(
- dev_name(master->dev.parent));
- if (!c->workqueue)
- goto exit_busy;
c->last_chipselect = -1;
dev_info(&dev->dev, "at %#llx, irq %d, %dMHz\n",
exit_busy:
ret = -EBUSY;
exit:
- if (c->workqueue)
- destroy_workqueue(c->workqueue);
clk_disable(c->clk);
spi_master_put(master);
return ret;
struct spi_master *master = platform_get_drvdata(dev);
struct txx9spi *c = spi_master_get_devdata(master);
- destroy_workqueue(c->workqueue);
+ flush_work(&c->work);
clk_disable(c->clk);
return 0;
}