diff mbox series

[PRE-REVIEW,03/16] mmc: renesas_sdhi: Prepare to use the new tasklet API

Message ID 20190929163028.9665-4-romain.perier@gmail.com (mailing list archive)
State New, archived
Headers show
Series Modernize the tasklet API | expand

Commit Message

Romain Perier Sept. 29, 2019, 4:30 p.m. UTC
From: Romain Perier <romain.perier@viveris.fr>

The future tasklet API will no longer allow to pass an arbitrary
"unsigned long" data parameter. The tasklet data structure will need to
be embedded into a data structure that will be retrieved from the tasklet
handler. Then, all other data structure that must be retrieved from the
handler (by using the tasklet as root object) must be retrievable via
container_of(). This commits adds a field to get the address of the
device binded to this driver, so the corresponding platform_device and
its drvdata can be retrieved from the tasklet handler.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
---
 drivers/mmc/host/renesas_sdhi.h      | 1 +
 drivers/mmc/host/renesas_sdhi_core.c | 2 ++
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index c0504aa90857..01ef8ff5b525 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -42,6 +42,7 @@  struct tmio_mmc_dma {
 };
 
 struct renesas_sdhi {
+	struct platform_device *pdev;
 	struct clk *clk;
 	struct clk *clk_cd;
 	struct tmio_mmc_data mmc_data;
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index d4ada5cca2d1..ceb3b0af1470 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -843,6 +843,8 @@  int renesas_sdhi_probe(struct platform_device *pdev,
 		goto eirq;
 	}
 
+	priv->pdev = pdev;
+
 	dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
 		 mmc_hostname(host->mmc), (unsigned long)
 		 (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),