aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/atmel-mci.c13
-rw-r--r--drivers/mmc/host/jz4740_mmc.c7
-rw-r--r--drivers/mmc/host/meson-mx-sdio.c7
-rw-r--r--drivers/mmc/host/mvsdio.c6
-rw-r--r--drivers/mmc/host/mxcmmc.c7
-rw-r--r--drivers/mmc/host/omap.c20
-rw-r--r--drivers/mmc/host/sdhci.c13
-rw-r--r--drivers/mmc/host/tifm_sd.c6
-rw-r--r--drivers/mmc/host/via-sdmmc.c6
-rw-r--r--drivers/mmc/host/vub300.c17
-rw-r--r--drivers/mmc/host/wbsd.c7
11 files changed, 51 insertions, 58 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 0a0ebf3a096d..e55f3932d580 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -732,11 +732,11 @@ static inline unsigned int atmci_convert_chksize(struct atmel_mci *host,
732 return 0; 732 return 0;
733} 733}
734 734
735static void atmci_timeout_timer(unsigned long data) 735static void atmci_timeout_timer(struct timer_list *t)
736{ 736{
737 struct atmel_mci *host; 737 struct atmel_mci *host;
738 738
739 host = (struct atmel_mci *)data; 739 host = from_timer(host, t, timer);
740 740
741 dev_dbg(&host->pdev->dev, "software timeout\n"); 741 dev_dbg(&host->pdev->dev, "software timeout\n");
742 742
@@ -1661,9 +1661,9 @@ static void atmci_command_complete(struct atmel_mci *host,
1661 cmd->error = 0; 1661 cmd->error = 0;
1662} 1662}
1663 1663
1664static void atmci_detect_change(unsigned long data) 1664static void atmci_detect_change(struct timer_list *t)
1665{ 1665{
1666 struct atmel_mci_slot *slot = (struct atmel_mci_slot *)data; 1666 struct atmel_mci_slot *slot = from_timer(slot, t, detect_timer);
1667 bool present; 1667 bool present;
1668 bool present_old; 1668 bool present_old;
1669 1669
@@ -2349,8 +2349,7 @@ static int atmci_init_slot(struct atmel_mci *host,
2349 if (gpio_is_valid(slot->detect_pin)) { 2349 if (gpio_is_valid(slot->detect_pin)) {
2350 int ret; 2350 int ret;
2351 2351
2352 setup_timer(&slot->detect_timer, atmci_detect_change, 2352 timer_setup(&slot->detect_timer, atmci_detect_change, 0);
2353 (unsigned long)slot);
2354 2353
2355 ret = request_irq(gpio_to_irq(slot->detect_pin), 2354 ret = request_irq(gpio_to_irq(slot->detect_pin),
2356 atmci_detect_interrupt, 2355 atmci_detect_interrupt,
@@ -2563,7 +2562,7 @@ static int atmci_probe(struct platform_device *pdev)
2563 2562
2564 platform_set_drvdata(pdev, host); 2563 platform_set_drvdata(pdev, host);
2565 2564
2566 setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host); 2565 timer_setup(&host->timer, atmci_timeout_timer, 0);
2567 2566
2568 pm_runtime_get_noresume(&pdev->dev); 2567 pm_runtime_get_noresume(&pdev->dev);
2569 pm_runtime_set_active(&pdev->dev); 2568 pm_runtime_set_active(&pdev->dev);
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index 7db8c7a8d38d..712e08d9a45e 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -586,9 +586,9 @@ poll_timeout:
586 return true; 586 return true;
587} 587}
588 588
589static void jz4740_mmc_timeout(unsigned long data) 589static void jz4740_mmc_timeout(struct timer_list *t)
590{ 590{
591 struct jz4740_mmc_host *host = (struct jz4740_mmc_host *)data; 591 struct jz4740_mmc_host *host = from_timer(host, t, timeout_timer);
592 592
593 if (!test_and_clear_bit(0, &host->waiting)) 593 if (!test_and_clear_bit(0, &host->waiting))
594 return; 594 return;
@@ -1036,8 +1036,7 @@ static int jz4740_mmc_probe(struct platform_device* pdev)
1036 1036
1037 jz4740_mmc_reset(host); 1037 jz4740_mmc_reset(host);
1038 jz4740_mmc_clock_disable(host); 1038 jz4740_mmc_clock_disable(host);
1039 setup_timer(&host->timeout_timer, jz4740_mmc_timeout, 1039 timer_setup(&host->timeout_timer, jz4740_mmc_timeout, 0);
1040 (unsigned long)host);
1041 1040
1042 host->use_dma = true; 1041 host->use_dma = true;
1043 if (host->use_dma && jz4740_mmc_acquire_dma_channels(host) != 0) 1042 if (host->use_dma && jz4740_mmc_acquire_dma_channels(host) != 0)
diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c
index ce1d9216b5a7..09cb89645d06 100644
--- a/drivers/mmc/host/meson-mx-sdio.c
+++ b/drivers/mmc/host/meson-mx-sdio.c
@@ -474,9 +474,9 @@ static irqreturn_t meson_mx_mmc_irq_thread(int irq, void *irq_data)
474 return IRQ_HANDLED; 474 return IRQ_HANDLED;
475} 475}
476 476
477static void meson_mx_mmc_timeout(unsigned long arg) 477static void meson_mx_mmc_timeout(struct timer_list *t)
478{ 478{
479 struct meson_mx_mmc_host *host = (void *) arg; 479 struct meson_mx_mmc_host *host = from_timer(host, t, cmd_timeout);
480 unsigned long irqflags; 480 unsigned long irqflags;
481 u32 irqc; 481 u32 irqc;
482 482
@@ -652,8 +652,7 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)
652 host->controller_dev = &pdev->dev; 652 host->controller_dev = &pdev->dev;
653 653
654 spin_lock_init(&host->irq_lock); 654 spin_lock_init(&host->irq_lock);
655 setup_timer(&host->cmd_timeout, meson_mx_mmc_timeout, 655 timer_setup(&host->cmd_timeout, meson_mx_mmc_timeout, 0);
656 (unsigned long)host);
657 656
658 platform_set_drvdata(pdev, host); 657 platform_set_drvdata(pdev, host);
659 658
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 58d74b8d6c79..210247b3d11a 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -508,9 +508,9 @@ static irqreturn_t mvsd_irq(int irq, void *dev)
508 return IRQ_NONE; 508 return IRQ_NONE;
509} 509}
510 510
511static void mvsd_timeout_timer(unsigned long data) 511static void mvsd_timeout_timer(struct timer_list *t)
512{ 512{
513 struct mvsd_host *host = (struct mvsd_host *)data; 513 struct mvsd_host *host = from_timer(host, t, timer);
514 void __iomem *iobase = host->base; 514 void __iomem *iobase = host->base;
515 struct mmc_request *mrq; 515 struct mmc_request *mrq;
516 unsigned long flags; 516 unsigned long flags;
@@ -776,7 +776,7 @@ static int mvsd_probe(struct platform_device *pdev)
776 goto out; 776 goto out;
777 } 777 }
778 778
779 setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host); 779 timer_setup(&host->timer, mvsd_timeout_timer, 0);
780 platform_set_drvdata(pdev, mmc); 780 platform_set_drvdata(pdev, mmc);
781 ret = mmc_add_host(mmc); 781 ret = mmc_add_host(mmc);
782 if (ret) 782 if (ret)
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 8bd9f060be2a..5ff8ef7223cc 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -963,10 +963,9 @@ static bool filter(struct dma_chan *chan, void *param)
963 return true; 963 return true;
964} 964}
965 965
966static void mxcmci_watchdog(unsigned long data) 966static void mxcmci_watchdog(struct timer_list *t)
967{ 967{
968 struct mmc_host *mmc = (struct mmc_host *)data; 968 struct mxcmci_host *host = from_timer(host, t, watchdog);
969 struct mxcmci_host *host = mmc_priv(mmc);
970 struct mmc_request *req = host->req; 969 struct mmc_request *req = host->req;
971 unsigned int stat = mxcmci_readl(host, MMC_REG_STATUS); 970 unsigned int stat = mxcmci_readl(host, MMC_REG_STATUS);
972 971
@@ -1165,7 +1164,7 @@ static int mxcmci_probe(struct platform_device *pdev)
1165 goto out_free_dma; 1164 goto out_free_dma;
1166 } 1165 }
1167 1166
1168 setup_timer(&host->watchdog, &mxcmci_watchdog, (unsigned long)mmc); 1167 timer_setup(&host->watchdog, mxcmci_watchdog, 0);
1169 1168
1170 mmc_add_host(mmc); 1169 mmc_add_host(mmc);
1171 1170
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index bd49f34d7654..adf32682f27a 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -625,9 +625,9 @@ static void mmc_omap_abort_command(struct work_struct *work)
625} 625}
626 626
627static void 627static void
628mmc_omap_cmd_timer(unsigned long data) 628mmc_omap_cmd_timer(struct timer_list *t)
629{ 629{
630 struct mmc_omap_host *host = (struct mmc_omap_host *) data; 630 struct mmc_omap_host *host = from_timer(host, t, cmd_abort_timer);
631 unsigned long flags; 631 unsigned long flags;
632 632
633 spin_lock_irqsave(&host->slot_lock, flags); 633 spin_lock_irqsave(&host->slot_lock, flags);
@@ -654,9 +654,9 @@ mmc_omap_sg_to_buf(struct mmc_omap_host *host)
654} 654}
655 655
656static void 656static void
657mmc_omap_clk_timer(unsigned long data) 657mmc_omap_clk_timer(struct timer_list *t)
658{ 658{
659 struct mmc_omap_host *host = (struct mmc_omap_host *) data; 659 struct mmc_omap_host *host = from_timer(host, t, clk_timer);
660 660
661 mmc_omap_fclk_enable(host, 0); 661 mmc_omap_fclk_enable(host, 0);
662} 662}
@@ -874,9 +874,9 @@ void omap_mmc_notify_cover_event(struct device *dev, int num, int is_closed)
874 tasklet_hi_schedule(&slot->cover_tasklet); 874 tasklet_hi_schedule(&slot->cover_tasklet);
875} 875}
876 876
877static void mmc_omap_cover_timer(unsigned long arg) 877static void mmc_omap_cover_timer(struct timer_list *t)
878{ 878{
879 struct mmc_omap_slot *slot = (struct mmc_omap_slot *) arg; 879 struct mmc_omap_slot *slot = from_timer(slot, t, cover_timer);
880 tasklet_schedule(&slot->cover_tasklet); 880 tasklet_schedule(&slot->cover_tasklet);
881} 881}
882 882
@@ -1264,8 +1264,7 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)
1264 mmc->max_seg_size = mmc->max_req_size; 1264 mmc->max_seg_size = mmc->max_req_size;
1265 1265
1266 if (slot->pdata->get_cover_state != NULL) { 1266 if (slot->pdata->get_cover_state != NULL) {
1267 setup_timer(&slot->cover_timer, mmc_omap_cover_timer, 1267 timer_setup(&slot->cover_timer, mmc_omap_cover_timer, 0);
1268 (unsigned long)slot);
1269 tasklet_init(&slot->cover_tasklet, mmc_omap_cover_handler, 1268 tasklet_init(&slot->cover_tasklet, mmc_omap_cover_handler,
1270 (unsigned long)slot); 1269 (unsigned long)slot);
1271 } 1270 }
@@ -1352,11 +1351,10 @@ static int mmc_omap_probe(struct platform_device *pdev)
1352 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work); 1351 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);
1353 1352
1354 INIT_WORK(&host->cmd_abort_work, mmc_omap_abort_command); 1353 INIT_WORK(&host->cmd_abort_work, mmc_omap_abort_command);
1355 setup_timer(&host->cmd_abort_timer, mmc_omap_cmd_timer, 1354 timer_setup(&host->cmd_abort_timer, mmc_omap_cmd_timer, 0);
1356 (unsigned long) host);
1357 1355
1358 spin_lock_init(&host->clk_lock); 1356 spin_lock_init(&host->clk_lock);
1359 setup_timer(&host->clk_timer, mmc_omap_clk_timer, (unsigned long) host); 1357 timer_setup(&host->clk_timer, mmc_omap_clk_timer, 0);
1360 1358
1361 spin_lock_init(&host->dma_lock); 1359 spin_lock_init(&host->dma_lock);
1362 spin_lock_init(&host->slot_lock); 1360 spin_lock_init(&host->slot_lock);
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 1052b52045b1..2f14334e42df 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2407,12 +2407,12 @@ static void sdhci_tasklet_finish(unsigned long param)
2407 ; 2407 ;
2408} 2408}
2409 2409
2410static void sdhci_timeout_timer(unsigned long data) 2410static void sdhci_timeout_timer(struct timer_list *t)
2411{ 2411{
2412 struct sdhci_host *host; 2412 struct sdhci_host *host;
2413 unsigned long flags; 2413 unsigned long flags;
2414 2414
2415 host = (struct sdhci_host*)data; 2415 host = from_timer(host, t, timer);
2416 2416
2417 spin_lock_irqsave(&host->lock, flags); 2417 spin_lock_irqsave(&host->lock, flags);
2418 2418
@@ -2429,12 +2429,12 @@ static void sdhci_timeout_timer(unsigned long data)
2429 spin_unlock_irqrestore(&host->lock, flags); 2429 spin_unlock_irqrestore(&host->lock, flags);
2430} 2430}
2431 2431
2432static void sdhci_timeout_data_timer(unsigned long data) 2432static void sdhci_timeout_data_timer(struct timer_list *t)
2433{ 2433{
2434 struct sdhci_host *host; 2434 struct sdhci_host *host;
2435 unsigned long flags; 2435 unsigned long flags;
2436 2436
2437 host = (struct sdhci_host *)data; 2437 host = from_timer(host, t, data_timer);
2438 2438
2439 spin_lock_irqsave(&host->lock, flags); 2439 spin_lock_irqsave(&host->lock, flags);
2440 2440
@@ -3749,9 +3749,8 @@ int __sdhci_add_host(struct sdhci_host *host)
3749 tasklet_init(&host->finish_tasklet, 3749 tasklet_init(&host->finish_tasklet,
3750 sdhci_tasklet_finish, (unsigned long)host); 3750 sdhci_tasklet_finish, (unsigned long)host);
3751 3751
3752 setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host); 3752 timer_setup(&host->timer, sdhci_timeout_timer, 0);
3753 setup_timer(&host->data_timer, sdhci_timeout_data_timer, 3753 timer_setup(&host->data_timer, sdhci_timeout_data_timer, 0);
3754 (unsigned long)host);
3755 3754
3756 init_waitqueue_head(&host->buf_ready_int); 3755 init_waitqueue_head(&host->buf_ready_int);
3757 3756
diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index 93c4b40df90a..a3d8380ab480 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -783,9 +783,9 @@ static void tifm_sd_end_cmd(unsigned long data)
783 mmc_request_done(mmc, mrq); 783 mmc_request_done(mmc, mrq);
784} 784}
785 785
786static void tifm_sd_abort(unsigned long data) 786static void tifm_sd_abort(struct timer_list *t)
787{ 787{
788 struct tifm_sd *host = (struct tifm_sd*)data; 788 struct tifm_sd *host = from_timer(host, t, timer);
789 789
790 pr_err("%s : card failed to respond for a long period of time " 790 pr_err("%s : card failed to respond for a long period of time "
791 "(%x, %x)\n", 791 "(%x, %x)\n",
@@ -968,7 +968,7 @@ static int tifm_sd_probe(struct tifm_dev *sock)
968 968
969 tasklet_init(&host->finish_tasklet, tifm_sd_end_cmd, 969 tasklet_init(&host->finish_tasklet, tifm_sd_end_cmd,
970 (unsigned long)host); 970 (unsigned long)host);
971 setup_timer(&host->timer, tifm_sd_abort, (unsigned long)host); 971 timer_setup(&host->timer, tifm_sd_abort, 0);
972 972
973 mmc->ops = &tifm_sd_ops; 973 mmc->ops = &tifm_sd_ops;
974 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; 974 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c
index a8c97b6e59dc..32c4211506fc 100644
--- a/drivers/mmc/host/via-sdmmc.c
+++ b/drivers/mmc/host/via-sdmmc.c
@@ -932,12 +932,12 @@ out:
932 return result; 932 return result;
933} 933}
934 934
935static void via_sdc_timeout(unsigned long ulongdata) 935static void via_sdc_timeout(struct timer_list *t)
936{ 936{
937 struct via_crdr_mmc_host *sdhost; 937 struct via_crdr_mmc_host *sdhost;
938 unsigned long flags; 938 unsigned long flags;
939 939
940 sdhost = (struct via_crdr_mmc_host *)ulongdata; 940 sdhost = from_timer(sdhost, t, timer);
941 941
942 spin_lock_irqsave(&sdhost->lock, flags); 942 spin_lock_irqsave(&sdhost->lock, flags);
943 943
@@ -1036,7 +1036,7 @@ static void via_init_mmc_host(struct via_crdr_mmc_host *host)
1036 u32 lenreg; 1036 u32 lenreg;
1037 u32 status; 1037 u32 status;
1038 1038
1039 setup_timer(&host->timer, via_sdc_timeout, (unsigned long)host); 1039 timer_setup(&host->timer, via_sdc_timeout, 0);
1040 1040
1041 spin_lock_init(&host->lock); 1041 spin_lock_init(&host->lock);
1042 1042
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index c1a169843f99..e6091528aca3 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -741,9 +741,10 @@ static void vub300_deadwork_thread(struct work_struct *work)
741 kref_put(&vub300->kref, vub300_delete); 741 kref_put(&vub300->kref, vub300_delete);
742} 742}
743 743
744static void vub300_inactivity_timer_expired(unsigned long data) 744static void vub300_inactivity_timer_expired(struct timer_list *t)
745{ /* softirq */ 745{ /* softirq */
746 struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)data; 746 struct vub300_mmc_host *vub300 = from_timer(vub300, t,
747 inactivity_timer);
747 if (!vub300->interface) { 748 if (!vub300->interface) {
748 kref_put(&vub300->kref, vub300_delete); 749 kref_put(&vub300->kref, vub300_delete);
749 } else if (vub300->cmd) { 750 } else if (vub300->cmd) {
@@ -1180,9 +1181,10 @@ static void send_command(struct vub300_mmc_host *vub300)
1180 * timer callback runs in atomic mode 1181 * timer callback runs in atomic mode
1181 * so it cannot call usb_kill_urb() 1182 * so it cannot call usb_kill_urb()
1182 */ 1183 */
1183static void vub300_sg_timed_out(unsigned long data) 1184static void vub300_sg_timed_out(struct timer_list *t)
1184{ 1185{
1185 struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)data; 1186 struct vub300_mmc_host *vub300 = from_timer(vub300, t,
1187 sg_transfer_timer);
1186 vub300->usb_timed_out = 1; 1188 vub300->usb_timed_out = 1;
1187 usb_sg_cancel(&vub300->sg_request); 1189 usb_sg_cancel(&vub300->sg_request);
1188 usb_unlink_urb(vub300->command_out_urb); 1190 usb_unlink_urb(vub300->command_out_urb);
@@ -2323,11 +2325,10 @@ static int vub300_probe(struct usb_interface *interface,
2323 INIT_WORK(&vub300->cmndwork, vub300_cmndwork_thread); 2325 INIT_WORK(&vub300->cmndwork, vub300_cmndwork_thread);
2324 INIT_WORK(&vub300->deadwork, vub300_deadwork_thread); 2326 INIT_WORK(&vub300->deadwork, vub300_deadwork_thread);
2325 kref_init(&vub300->kref); 2327 kref_init(&vub300->kref);
2326 setup_timer(&vub300->sg_transfer_timer, vub300_sg_timed_out, 2328 timer_setup(&vub300->sg_transfer_timer, vub300_sg_timed_out, 0);
2327 (unsigned long)vub300);
2328 kref_get(&vub300->kref); 2329 kref_get(&vub300->kref);
2329 setup_timer(&vub300->inactivity_timer, 2330 timer_setup(&vub300->inactivity_timer,
2330 vub300_inactivity_timer_expired, (unsigned long)vub300); 2331 vub300_inactivity_timer_expired, 0);
2331 vub300->inactivity_timer.expires = jiffies + HZ; 2332 vub300->inactivity_timer.expires = jiffies + HZ;
2332 add_timer(&vub300->inactivity_timer); 2333 add_timer(&vub300->inactivity_timer);
2333 if (vub300->card_present) 2334 if (vub300->card_present)
diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c
index 499852d8f706..f4233576153b 100644
--- a/drivers/mmc/host/wbsd.c
+++ b/drivers/mmc/host/wbsd.c
@@ -956,9 +956,9 @@ static const struct mmc_host_ops wbsd_ops = {
956 * Helper function to reset detection ignore 956 * Helper function to reset detection ignore
957 */ 957 */
958 958
959static void wbsd_reset_ignore(unsigned long data) 959static void wbsd_reset_ignore(struct timer_list *t)
960{ 960{
961 struct wbsd_host *host = (struct wbsd_host *)data; 961 struct wbsd_host *host = from_timer(host, t, ignore_timer);
962 962
963 BUG_ON(host == NULL); 963 BUG_ON(host == NULL);
964 964
@@ -1224,8 +1224,7 @@ static int wbsd_alloc_mmc(struct device *dev)
1224 /* 1224 /*
1225 * Set up timers 1225 * Set up timers
1226 */ 1226 */
1227 setup_timer(&host->ignore_timer, wbsd_reset_ignore, 1227 timer_setup(&host->ignore_timer, wbsd_reset_ignore, 0);
1228 (unsigned long)host);
1229 1228
1230 /* 1229 /*
1231 * Maximum number of segments. Worst case is one sector per segment 1230 * Maximum number of segments. Worst case is one sector per segment