drivers: mmc: Update trivial tasklet_init() callers
Subsystems (9)
cover drivers: mmc: Update trivial tasklet_init() callers
This updates callers of tasklet_init() in drivers/mmc to the new API in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
All changes are made by coccinelle using the following semantic patch:
@ match @
type T;
T *container;
identifier tasklet;
identifier callback;
@@
tasklet_init(&container->tasklet, callback, (unsigned long)container);
@ patch1 depends on match @
type match.T;
identifier match.tasklet;
identifier match.callback;
identifier data;
identifier container;
@@
-void callback(unsigned long data)
+void callback(struct tasklet_struct *t)
{
...
- T *container = \( (T *)data \| (void *)data \);
+ T *container = from_tasklet(container, t, tasklet);
...
}@ patch2 depends on match @
type match.T;
identifier match.tasklet;
identifier match.callback;
identifier data;
identifier container;
@@
-void callback(unsigned long data)
+void callback(struct tasklet_struct *t)
{
...
- T *container;
+ T *container = from_tasklet(container, t, tasklet);
...
- container = \( (T *)data \| (void *)data \);
...
}@ depends on (patch1 || patch2) @
match.T *container;
identifier match.tasklet;
identifier match.callback;
@@
- tasklet_init(&container->tasklet, callback, (unsigned long)container);
+ tasklet_setup(&container->tasklet, callback);
Emil Renner Berthing (9):
mmc: atmel-mci: Use new tasklet API
mmc: au1xmmc: Use new tasklet API
mmc: dw_mmc: Use new tasklet API
mmc: omap: Use new tasklet API
mmc: s3cmci: Use new tasklet API
mmc: tifm_sd: Use new tasklet API
mmc: uniphier-sd: Use new tasklet API
mmc: via-sdmmc: Use new tasklet API
mmc: wbsd: Use new tasklet API
drivers/mmc/host/atmel-mci.c | 6 +++--- drivers/mmc/host/au1xmmc.c | 14 ++++++-------- drivers/mmc/host/dw_mmc.c | 6 +++--- drivers/mmc/host/omap.c | 7 +++---- drivers/mmc/host/s3cmci.c | 6 +++--- drivers/mmc/host/tifm_sd.c | 7 +++---- drivers/mmc/host/uniphier-sd.c | 14 ++++++-------- drivers/mmc/host/via-sdmmc.c | 9 +++------ drivers/mmc/host/wbsd.c | 35 +++++++++++++++------------------- 9 files changed, 45 insertions(+), 59 deletions(-)
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/9 mmc: atmel-mci: Use new tasklet API
This converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/atmel-mci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/atmel-mci.c +3 -3
@@ -1719,9 +1719,9 @@ static void atmci_detect_change(struct timer_list *t) } } -static void atmci_tasklet_func (unsigned long priv) +static void atmci_tasklet_func (struct tasklet_struct *t) { -struct atmel_mci *host = (struct atmel_mci *)priv; +struct atmel_mci *host =from_tasklet (host, t, tasklet);struct mmc_request *mrq = host->mrq;struct mmc_data *data = host->data;enum atmel_mci_state state = host->state;
@@ -2496,7 +2496,7 @@ static int atmci_probe(struct platform_device *pdev) host->mapbase = regs->start; -tasklet_init (&host->tasklet, atmci_tasklet_func, (unsigned long )host); +tasklet_setup (&host->tasklet, atmci_tasklet_func); ret =request_irq (irq, atmci_interrupt,0 ,dev_name (&pdev->dev), host);if (ret) {
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 2/9 mmc: au1xmmc: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/au1xmmc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/mmc/host/au1xmmc.c +6 -8
@@ -253,9 +253,9 @@ static void au1xmmc_finish_request(struct au1xmmc_host *host)mmc_request_done (host->mmc, mrq); } -static void au1xmmc_tasklet_finish (unsigned long param) +static void au1xmmc_tasklet_finish (struct tasklet_struct *t) { -struct au1xmmc_host *host = (struct au1xmmc_host *) param; +struct au1xmmc_host *host =from_tasklet (host, t, finish_task);au1xmmc_finish_request (host); }
@@ -363,9 +363,9 @@ static void au1xmmc_data_complete(struct au1xmmc_host *host, u32 status)au1xmmc_finish_request (host); } -static void au1xmmc_tasklet_data (unsigned long param) +static void au1xmmc_tasklet_data (struct tasklet_struct *t) { -struct au1xmmc_host *host = (struct au1xmmc_host *)param; +struct au1xmmc_host *host =from_tasklet (host, t, data_task);u32 status =__raw_readl (HOST_STATUS (host));au1xmmc_data_complete (host, status);
@@ -1037,11 +1037,9 @@ static int au1xmmc_probe(struct platform_device *pdev)if (host->platdata) mmc->caps &= ~(host->platdata->mask_host_caps); -tasklet_init (&host->data_task, au1xmmc_tasklet_data, - (unsigned long )host); +tasklet_setup (&host->data_task, au1xmmc_tasklet_data); -tasklet_init (&host->finish_task, au1xmmc_tasklet_finish, - (unsigned long )host); +tasklet_setup (&host->finish_task, au1xmmc_tasklet_finish);if (has_dbdma ()) { ret =au1xmmc_dbdma_init (host);
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 3/9 mmc: dw_mmc: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/dw_mmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -3
@@ -1952,9 +1952,9 @@ static bool dw_mci_clear_pending_data_complete(struct dw_mci *host)return true; } -static void dw_mci_tasklet_func (unsigned long priv) +static void dw_mci_tasklet_func (struct tasklet_struct *t) { -struct dw_mci *host = (struct dw_mci *)priv; +struct dw_mci *host =from_tasklet (host, t, tasklet);struct mmc_data *data;struct mmc_command *cmd;struct mmc_request *mrq;
@@ -3308,7 +3308,7 @@ int dw_mci_probe(struct dw_mci *host)else host->fifo_reg = host->regs +DATA_240A_OFFSET ; -tasklet_init (&host->tasklet, dw_mci_tasklet_func, (unsigned long )host); +tasklet_setup (&host->tasklet, dw_mci_tasklet_func); ret =devm_request_irq (host->dev, host->irq, dw_mci_interrupt, host->irq_flags,"dw-mci" , host);if (ret)
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 4/9 mmc: omap: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/omap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/mmc/host/omap.c +3 -4
@@ -878,9 +878,9 @@ static void mmc_omap_cover_timer(struct timer_list *t)tasklet_schedule (&slot->cover_tasklet); } -static void mmc_omap_cover_handler (unsigned long param) +static void mmc_omap_cover_handler (struct tasklet_struct *t) { -struct mmc_omap_slot *slot = (struct mmc_omap_slot *)param; +struct mmc_omap_slot *slot =from_tasklet (slot, t, cover_tasklet);int cover_open =mmc_omap_cover_is_open (slot);mmc_detect_change (slot->mmc,0 );
@@ -1269,8 +1269,7 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)if (slot->pdata->get_cover_state !=NULL ) {timer_setup (&slot->cover_timer, mmc_omap_cover_timer,0 ); -tasklet_init (&slot->cover_tasklet, mmc_omap_cover_handler, - (unsigned long )slot); +tasklet_setup (&slot->cover_tasklet, mmc_omap_cover_handler); } r =mmc_add_host (mmc);
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 5/9 mmc: s3cmci: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/s3cmci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/s3cmci.c +3 -3
@@ -540,9 +540,9 @@ static void do_pio_write(struct s3cmci_host *host)enable_imask (host,S3C2410_SDIIMSK_TXFIFOHALF ); } -static void pio_tasklet (unsigned long data) +static void pio_tasklet (struct tasklet_struct *t) { -struct s3cmci_host *host = (struct s3cmci_host *) data; +struct s3cmci_host *host =from_tasklet (host, t, pio_tasklet);s3cmci_disable_irq (host, true);
@@ -1532,7 +1532,7 @@ static int s3cmci_probe(struct platform_device *pdev) host->pdata = pdev->dev.platform_data;spin_lock_init (&host->complete_lock); -tasklet_init (&host->pio_tasklet, pio_tasklet, (unsigned long ) host); +tasklet_setup (&host->pio_tasklet, pio_tasklet);if (host->is2440) { host->sdiimsk =S3C2440_SDIIMSK ;
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 6/9 mmc: tifm_sd: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/tifm_sd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/mmc/host/tifm_sd.c +3 -4
@@ -731,9 +731,9 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)mmc_request_done (mmc, mrq); } -static void tifm_sd_end_cmd (unsigned long data) +static void tifm_sd_end_cmd (struct tasklet_struct *t) { -struct tifm_sd *host = (struct tifm_sd *)data; +struct tifm_sd *host =from_tasklet (host, t, finish_tasklet);struct tifm_dev *sock = host->dev;struct mmc_host *mmc =tifm_get_drvdata (sock);struct mmc_request *mrq;
@@ -968,8 +968,7 @@ static int tifm_sd_probe(struct tifm_dev *sock)*/ mmc->max_busy_timeout =TIFM_MMCSD_REQ_TIMEOUT_MS ; -tasklet_init (&host->finish_tasklet, tifm_sd_end_cmd, - (unsigned long )host); +tasklet_setup (&host->finish_tasklet, tifm_sd_end_cmd);timer_setup (&host->timer, tifm_sd_abort,0 ); mmc->ops = &tifm_sd_ops;
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 7/9 mmc: uniphier-sd: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/uniphier-sd.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/mmc/host/uniphier-sd.c +6 -8
@@ -81,9 +81,9 @@ static void uniphier_sd_dma_endisable(struct tmio_mmc_host *host, int enable) }/* external DMA engine */ -static void uniphier_sd_external_dma_issue (unsigned long arg) +static void uniphier_sd_external_dma_issue (struct tasklet_struct *t) { -struct tmio_mmc_host *host = (void *)arg; +struct tmio_mmc_host *host =from_tasklet (host, t, dma_issue);struct uniphier_sd_priv *priv =uniphier_sd_priv (host);uniphier_sd_dma_endisable (host,1 );
@@ -190,8 +190,7 @@ static void uniphier_sd_external_dma_request(struct tmio_mmc_host *host, host->chan_rx = chan; host->chan_tx = chan; -tasklet_init (&host->dma_issue, uniphier_sd_external_dma_issue, - (unsigned long )host); +tasklet_setup (&host->dma_issue, uniphier_sd_external_dma_issue); }static void uniphier_sd_external_dma_release (struct tmio_mmc_host *host)
@@ -228,9 +227,9 @@ static const struct tmio_mmc_dma_ops uniphier_sd_external_dma_ops = { .dataend = uniphier_sd_external_dma_dataend, }; -static void uniphier_sd_internal_dma_issue (unsigned long arg) +static void uniphier_sd_internal_dma_issue (struct tasklet_struct *t) { -struct tmio_mmc_host *host = (void *)arg; +struct tmio_mmc_host *host =from_tasklet (host, t, dma_issue);unsigned long flags;spin_lock_irqsave (&host->lock, flags);
@@ -309,8 +308,7 @@ static void uniphier_sd_internal_dma_request(struct tmio_mmc_host *host, host->chan_tx = (void *)0xdeadbeaf ; -tasklet_init (&host->dma_issue, uniphier_sd_internal_dma_issue, - (unsigned long )host); +tasklet_setup (&host->dma_issue, uniphier_sd_internal_dma_issue); }static void uniphier_sd_internal_dma_release (struct tmio_mmc_host *host)
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 8/9 mmc: via-sdmmc: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/via-sdmmc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/mmc/host/via-sdmmc.c +3 -6
@@ -959,14 +959,12 @@ static void via_sdc_timeout(struct timer_list *t)spin_unlock_irqrestore (&sdhost->lock, flags); } -static void via_sdc_tasklet_finish (unsigned long param) +static void via_sdc_tasklet_finish (struct tasklet_struct *t) { -struct via_crdr_mmc_host *host; +struct via_crdr_mmc_host *host =from_tasklet (host, t, finish_tasklet);unsigned long flags;struct mmc_request *mrq; - host = (struct via_crdr_mmc_host *)param; -spin_lock_irqsave (&host->lock, flags);del_timer (&host->timer);
@@ -1050,8 +1048,7 @@ static void via_init_mmc_host(struct via_crdr_mmc_host *host)INIT_WORK (&host->carddet_work, via_sdc_card_detect); -tasklet_init (&host->finish_tasklet, via_sdc_tasklet_finish, - (unsigned long )host); +tasklet_setup (&host->finish_tasklet, via_sdc_tasklet_finish); addrbase = host->sdhc_mmiobase;writel (0x0 , addrbase +VIA_CRDR_SDINTMASK );
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 9/9 mmc: wbsd: Use new tasklet API
In reply to Emil Renner BerthingThis converts the driver to use the new tasklet API introduced in commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
--- drivers/mmc/host/wbsd.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-)
drivers/mmc/host/wbsd.c +15 -20
@@ -987,9 +987,9 @@ static inline struct mmc_data *wbsd_get_data(struct wbsd_host *host)return host->mrq->cmd->data; } -static void wbsd_tasklet_card (unsigned long param) +static void wbsd_tasklet_card (struct tasklet_struct *t) { -struct wbsd_host *host = (struct wbsd_host *)param; +struct wbsd_host *host =from_tasklet (host, t, card_tasklet);u8 csr;int delay =-1 ;
@@ -1036,9 +1036,9 @@ static void wbsd_tasklet_card(unsigned long param)mmc_detect_change (host->mmc,msecs_to_jiffies (delay)); } -static void wbsd_tasklet_fifo (unsigned long param) +static void wbsd_tasklet_fifo (struct tasklet_struct *t) { -struct wbsd_host *host = (struct wbsd_host *)param; +struct wbsd_host *host =from_tasklet (host, t, fifo_tasklet);struct mmc_data *data;spin_lock (&host->lock);
@@ -1067,9 +1067,9 @@ static void wbsd_tasklet_fifo(unsigned long param)spin_unlock (&host->lock); } -static void wbsd_tasklet_crc (unsigned long param) +static void wbsd_tasklet_crc (struct tasklet_struct *t) { -struct wbsd_host *host = (struct wbsd_host *)param; +struct wbsd_host *host =from_tasklet (host, t, crc_tasklet);struct mmc_data *data;spin_lock (&host->lock);
@@ -1091,9 +1091,9 @@ static void wbsd_tasklet_crc(unsigned long param)spin_unlock (&host->lock); } -static void wbsd_tasklet_timeout (unsigned long param) +static void wbsd_tasklet_timeout (struct tasklet_struct *t) { -struct wbsd_host *host = (struct wbsd_host *)param; +struct wbsd_host *host =from_tasklet (host, t, timeout_tasklet);struct mmc_data *data;spin_lock (&host->lock);
@@ -1115,9 +1115,9 @@ static void wbsd_tasklet_timeout(unsigned long param)spin_unlock (&host->lock); } -static void wbsd_tasklet_finish (unsigned long param) +static void wbsd_tasklet_finish (struct tasklet_struct *t) { -struct wbsd_host *host = (struct wbsd_host *)param; +struct wbsd_host *host =from_tasklet (host, t, finish_tasklet);struct mmc_data *data;spin_lock (&host->lock);
@@ -1449,16 +1449,11 @@ static int wbsd_request_irq(struct wbsd_host *host, int irq)/* * Set up tasklets. Must be done before requesting interrupt. */ -tasklet_init (&host->card_tasklet, wbsd_tasklet_card, - (unsigned long )host); -tasklet_init (&host->fifo_tasklet, wbsd_tasklet_fifo, - (unsigned long )host); -tasklet_init (&host->crc_tasklet, wbsd_tasklet_crc, - (unsigned long )host); -tasklet_init (&host->timeout_tasklet, wbsd_tasklet_timeout, - (unsigned long )host); -tasklet_init (&host->finish_tasklet, wbsd_tasklet_finish, - (unsigned long )host); +tasklet_setup (&host->card_tasklet, wbsd_tasklet_card); +tasklet_setup (&host->fifo_tasklet, wbsd_tasklet_fifo); +tasklet_setup (&host->crc_tasklet, wbsd_tasklet_crc); +tasklet_setup (&host->timeout_tasklet, wbsd_tasklet_timeout); +tasklet_setup (&host->finish_tasklet, wbsd_tasklet_finish);/* * Allocate interrupt.
Signature · 7 lines
2.30.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 68 lines · Emil Renner Berthing
This updates callers of
tasklet_init()indrivers/mmcto the new API in commit12cc923f1ccc("tasklet: Introduce new initialization API")All changes are made by coccinelle using the following semantic patch:
@ match @
type T;
T *container;
identifier tasklet;
identifier callback;
@@tasklet_init(&container->tasklet, callback, (unsigned long)container);@ patch1 depends on match @
type match.T;
identifier match.tasklet;
identifier match.callback;
identifier data;
identifier container;
@@(quoted diff) +1
-1-void callback(unsigned long data) +void callback(struct tasklet_struct *t){ ...(quoted diff) +1
-1- T *container = \( (T *)data \| (void *)data \); + T *container = from_tasklet(container, t, tasklet);}
@ patch2 depends on match @
type match.T;
identifier match.tasklet;
identifier match.callback;
identifier data;
identifier container;
@@(quoted diff) +1
-1-void callback(unsigned long data) +void callback(struct tasklet_struct *t){ ...(quoted diff) +1
-2- T *container; + T *container = from_tasklet(container, t, tasklet); - container = \( (T *)data \| (void *)data \);}
@ depends on (patch1 || patch2) @
match.T *container;
identifier match.tasklet;
identifier match.callback;
@@(quoted diff) +1
-1- tasklet_init(&container->tasklet, callback, (unsigned long)container); + tasklet_setup(&container->tasklet, callback);Emil Renner Berthing (9):
mmc: atmel-mci: Use new tasklet API
mmc: au1xmmc: Use new tasklet API
mmc:dw_mmc: Use new tasklet API
mmc: omap: Use new tasklet API
mmc: s3cmci: Use new tasklet API
mmc:tifm_sd: Use new tasklet API
mmc: uniphier-sd: Use new tasklet API
mmc: via-sdmmc: Use new tasklet API
mmc: wbsd: Use new tasklet API
Quoted 11 lines
drivers/mmc/host/atmel-mci.c | 6 +++--- drivers/mmc/host/au1xmmc.c | 14 ++++++-------- drivers/mmc/host/dw_mmc.c | 6 +++--- drivers/mmc/host/omap.c | 7 +++---- drivers/mmc/host/s3cmci.c | 6 +++--- drivers/mmc/host/tifm_sd.c | 7 +++---- drivers/mmc/host/uniphier-sd.c | 14 ++++++-------- drivers/mmc/host/via-sdmmc.c | 9 +++------ drivers/mmc/host/wbsd.c | 35 +++++++++++++++------------------- 9 files changed, 45 insertions(+), 59 deletions(-)
Applied for next, thanks!
Kind regards
Uffe
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel