* [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers
@ 2021-02-04 15:18 Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 1/9] mmc: atmel-mci: Use new tasklet API Emil Renner Berthing
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
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(-)
--
2.30.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/9] mmc: atmel-mci: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 2/9] mmc: au1xmmc: " Emil Renner Berthing
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/atmel-mci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 632412066eda..807177c953f3 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -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) {
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/9] mmc: au1xmmc: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 1/9] mmc: atmel-mci: Use new tasklet API Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 3/9] mmc: dw_mmc: " Emil Renner Berthing
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/au1xmmc.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index bd00515fbaba..0acc237843f7 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -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);
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/9] mmc: dw_mmc: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 1/9] mmc: atmel-mci: Use new tasklet API Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 2/9] mmc: au1xmmc: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 4/9] mmc: omap: " Emil Renner Berthing
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/dw_mmc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index a5244435556b..2f4de30f650b 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -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)
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/9] mmc: omap: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (2 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 3/9] mmc: dw_mmc: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 5/9] mmc: s3cmci: " Emil Renner Berthing
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/omap.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 6aa0537f1f84..5e5af34090f1 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -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);
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/9] mmc: s3cmci: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (3 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 4/9] mmc: omap: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 6/9] mmc: tifm_sd: " Emil Renner Berthing
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/s3cmci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c
index a33a7823c265..0ca6f6d30b75 100644
--- a/drivers/mmc/host/s3cmci.c
+++ b/drivers/mmc/host/s3cmci.c
@@ -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;
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 6/9] mmc: tifm_sd: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (4 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 5/9] mmc: s3cmci: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 7/9] mmc: uniphier-sd: " Emil Renner Berthing
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/tifm_sd.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/tifm_sd.c b/drivers/mmc/host/tifm_sd.c
index fd8b72d3e02c..9fdf7ea06e3f 100644
--- a/drivers/mmc/host/tifm_sd.c
+++ b/drivers/mmc/host/tifm_sd.c
@@ -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;
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 7/9] mmc: uniphier-sd: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (5 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 6/9] mmc: tifm_sd: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 8/9] mmc: via-sdmmc: " Emil Renner Berthing
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/uniphier-sd.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c
index a6cd16771d4e..2413b6750cec 100644
--- a/drivers/mmc/host/uniphier-sd.c
+++ b/drivers/mmc/host/uniphier-sd.c
@@ -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)
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 8/9] mmc: via-sdmmc: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (6 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 7/9] mmc: uniphier-sd: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 9/9] mmc: wbsd: " Emil Renner Berthing
2021-02-08 12:07 ` [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Ulf Hansson
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/via-sdmmc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c
index 9b755ea0fa03..4f4c0813f9fd 100644
--- a/drivers/mmc/host/via-sdmmc.c
+++ b/drivers/mmc/host/via-sdmmc.c
@@ -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);
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 9/9] mmc: wbsd: Use new tasklet API
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (7 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 8/9] mmc: via-sdmmc: " Emil Renner Berthing
@ 2021-02-04 15:18 ` Emil Renner Berthing
2021-02-08 12:07 ` [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Ulf Hansson
9 siblings, 0 replies; 11+ messages in thread
From: Emil Renner Berthing @ 2021-02-04 15:18 UTC (permalink / raw)
To: linux-mmc, linux-omap
Cc: Emil Renner Berthing, Ludovic Desroches, Ulf Hansson,
Nicolas Ferre, Alexandre Belloni, Manuel Lauss, Jaehoon Chung,
Aaro Koskinen, Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte,
Pierre Ossman, linux-arm-kernel, linux-kernel
This converts the driver to use the new tasklet API introduced in
commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
---
drivers/mmc/host/wbsd.c | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/drivers/mmc/host/wbsd.c b/drivers/mmc/host/wbsd.c
index cd63ea865b77..67ecd342fe5f 100644
--- a/drivers/mmc/host/wbsd.c
+++ b/drivers/mmc/host/wbsd.c
@@ -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.
--
2.30.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
` (8 preceding siblings ...)
2021-02-04 15:18 ` [PATCH 9/9] mmc: wbsd: " Emil Renner Berthing
@ 2021-02-08 12:07 ` Ulf Hansson
9 siblings, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2021-02-08 12:07 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: linux-mmc, linux-omap, Ludovic Desroches, Nicolas Ferre,
Alexandre Belloni, Manuel Lauss, Jaehoon Chung, Aaro Koskinen,
Ben Dooks, Alex Dubov, Bruce Chang, Harald Welte, Pierre Ossman,
Linux ARM, Linux Kernel Mailing List
On Thu, 4 Feb 2021 at 16:19, Emil Renner Berthing <kernel@esmil.dk> wrote:
>
> 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(-)
>
Applied for next, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-02-08 12:27 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:18 [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 1/9] mmc: atmel-mci: Use new tasklet API Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 2/9] mmc: au1xmmc: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 3/9] mmc: dw_mmc: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 4/9] mmc: omap: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 5/9] mmc: s3cmci: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 6/9] mmc: tifm_sd: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 7/9] mmc: uniphier-sd: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 8/9] mmc: via-sdmmc: " Emil Renner Berthing
2021-02-04 15:18 ` [PATCH 9/9] mmc: wbsd: " Emil Renner Berthing
2021-02-08 12:07 ` [PATCH 0/9] drivers: mmc: Update trivial tasklet_init() callers Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).