diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-24 10:00:17 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-24 10:00:17 -0500 |
commit | 0d9ee5b2e9aac981fa063339daf04320eac610d1 (patch) | |
tree | 38f3674addbef483da038421ef2b3f4b7c2d9234 | |
parent | afdb32f2e463a195c104555ac9a8cdd39a2b6561 (diff) |
mmc: update workqueue usages
Workqueue creation API has been updated and flush_scheduled_work() is
deprecated and scheduled to be removed.
* core/core.c: Use alloc_ordered_workqueue() instead of
create_singlethread_workqueue(). This removes an unnecessary
rescuer.
* host/omap.c: Create, use and flush mmc_omap_wq instead of the
system_wq.
* Flush host->mmc_carddetect_work directly on removal instead of using
flush_scheduled_work().
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org
-rw-r--r-- | drivers/mmc/core/core.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/omap.c | 24 | ||||
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 2 |
3 files changed, 20 insertions, 8 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8f86d702e46e..55b545fb60b4 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1789,7 +1789,7 @@ static int __init mmc_init(void) | |||
1789 | { | 1789 | { |
1790 | int ret; | 1790 | int ret; |
1791 | 1791 | ||
1792 | workqueue = create_singlethread_workqueue("kmmcd"); | 1792 | workqueue = alloc_ordered_workqueue("kmmcd", 0); |
1793 | if (!workqueue) | 1793 | if (!workqueue) |
1794 | return -ENOMEM; | 1794 | return -ENOMEM; |
1795 | 1795 | ||
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 0c7e37f496ef..379d2ffe4c87 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c | |||
@@ -173,6 +173,8 @@ struct mmc_omap_host { | |||
173 | struct omap_mmc_platform_data *pdata; | 173 | struct omap_mmc_platform_data *pdata; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct workqueue_struct *mmc_omap_wq; | ||
177 | |||
176 | static void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot) | 178 | static void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot) |
177 | { | 179 | { |
178 | unsigned long tick_ns; | 180 | unsigned long tick_ns; |
@@ -289,7 +291,7 @@ static void mmc_omap_release_slot(struct mmc_omap_slot *slot, int clk_enabled) | |||
289 | host->next_slot = new_slot; | 291 | host->next_slot = new_slot; |
290 | host->mmc = new_slot->mmc; | 292 | host->mmc = new_slot->mmc; |
291 | spin_unlock_irqrestore(&host->slot_lock, flags); | 293 | spin_unlock_irqrestore(&host->slot_lock, flags); |
292 | schedule_work(&host->slot_release_work); | 294 | queue_work(mmc_omap_wq, &host->slot_release_work); |
293 | return; | 295 | return; |
294 | } | 296 | } |
295 | 297 | ||
@@ -457,7 +459,7 @@ mmc_omap_xfer_done(struct mmc_omap_host *host, struct mmc_data *data) | |||
457 | } | 459 | } |
458 | 460 | ||
459 | host->stop_data = data; | 461 | host->stop_data = data; |
460 | schedule_work(&host->send_stop_work); | 462 | queue_work(mmc_omap_wq, &host->send_stop_work); |
461 | } | 463 | } |
462 | 464 | ||
463 | static void | 465 | static void |
@@ -637,7 +639,7 @@ mmc_omap_cmd_timer(unsigned long data) | |||
637 | OMAP_MMC_WRITE(host, IE, 0); | 639 | OMAP_MMC_WRITE(host, IE, 0); |
638 | disable_irq(host->irq); | 640 | disable_irq(host->irq); |
639 | host->abort = 1; | 641 | host->abort = 1; |
640 | schedule_work(&host->cmd_abort_work); | 642 | queue_work(mmc_omap_wq, &host->cmd_abort_work); |
641 | } | 643 | } |
642 | spin_unlock_irqrestore(&host->slot_lock, flags); | 644 | spin_unlock_irqrestore(&host->slot_lock, flags); |
643 | } | 645 | } |
@@ -826,7 +828,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id) | |||
826 | host->abort = 1; | 828 | host->abort = 1; |
827 | OMAP_MMC_WRITE(host, IE, 0); | 829 | OMAP_MMC_WRITE(host, IE, 0); |
828 | disable_irq_nosync(host->irq); | 830 | disable_irq_nosync(host->irq); |
829 | schedule_work(&host->cmd_abort_work); | 831 | queue_work(mmc_omap_wq, &host->cmd_abort_work); |
830 | return IRQ_HANDLED; | 832 | return IRQ_HANDLED; |
831 | } | 833 | } |
832 | 834 | ||
@@ -1387,7 +1389,7 @@ static void mmc_omap_remove_slot(struct mmc_omap_slot *slot) | |||
1387 | 1389 | ||
1388 | tasklet_kill(&slot->cover_tasklet); | 1390 | tasklet_kill(&slot->cover_tasklet); |
1389 | del_timer_sync(&slot->cover_timer); | 1391 | del_timer_sync(&slot->cover_timer); |
1390 | flush_scheduled_work(); | 1392 | flush_workqueue(mmc_omap_wq); |
1391 | 1393 | ||
1392 | mmc_remove_host(mmc); | 1394 | mmc_remove_host(mmc); |
1393 | mmc_free_host(mmc); | 1395 | mmc_free_host(mmc); |
@@ -1608,12 +1610,22 @@ static struct platform_driver mmc_omap_driver = { | |||
1608 | 1610 | ||
1609 | static int __init mmc_omap_init(void) | 1611 | static int __init mmc_omap_init(void) |
1610 | { | 1612 | { |
1611 | return platform_driver_probe(&mmc_omap_driver, mmc_omap_probe); | 1613 | int ret; |
1614 | |||
1615 | mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); | ||
1616 | if (!mmc_omap_wq) | ||
1617 | return -ENOMEM; | ||
1618 | |||
1619 | ret = platform_driver_probe(&mmc_omap_driver, mmc_omap_probe); | ||
1620 | if (ret) | ||
1621 | destroy_workqueue(mmc_omap_wq); | ||
1622 | return ret; | ||
1612 | } | 1623 | } |
1613 | 1624 | ||
1614 | static void __exit mmc_omap_exit(void) | 1625 | static void __exit mmc_omap_exit(void) |
1615 | { | 1626 | { |
1616 | platform_driver_unregister(&mmc_omap_driver); | 1627 | platform_driver_unregister(&mmc_omap_driver); |
1628 | destroy_workqueue(mmc_omap_wq); | ||
1617 | } | 1629 | } |
1618 | 1630 | ||
1619 | module_init(mmc_omap_init); | 1631 | module_init(mmc_omap_init); |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 82a1079bbdc7..9e136bbd2b61 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -2290,7 +2290,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev) | |||
2290 | free_irq(host->irq, host); | 2290 | free_irq(host->irq, host); |
2291 | if (mmc_slot(host).card_detect_irq) | 2291 | if (mmc_slot(host).card_detect_irq) |
2292 | free_irq(mmc_slot(host).card_detect_irq, host); | 2292 | free_irq(mmc_slot(host).card_detect_irq, host); |
2293 | flush_scheduled_work(); | 2293 | flush_work_sync(&host->mmc_carddetect_work); |
2294 | 2294 | ||
2295 | mmc_host_disable(host->mmc); | 2295 | mmc_host_disable(host->mmc); |
2296 | clk_disable(host->iclk); | 2296 | clk_disable(host->iclk); |