aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2018-03-08 09:52:53 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2018-03-15 09:43:23 -0400
commitcb1214d27a3ef8817a7a208d546aa9f947bf5f7d (patch)
treed96d6d7e1128b7a99f6f20a57b6fc5c45751aa42
parentd81819419b2be4eee6643681ce0366856a772ba9 (diff)
mmc: sunxi: Set our device drvdata earlier
As soon as the pm_runtime_enable hook is called, our runtime_suspend and runtime_resume hooks can be called as well. However, we only set the device drvdata that we will use after we have registered into the MMC core. Move that earlier so that we don't have a race that could lead to a crash. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sunxi-mmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index b747d65a7d15..20cfb20418f3 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1318,6 +1318,7 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
1318 dev_err(&pdev->dev, "mmc alloc host failed\n"); 1318 dev_err(&pdev->dev, "mmc alloc host failed\n");
1319 return -ENOMEM; 1319 return -ENOMEM;
1320 } 1320 }
1321 platform_set_drvdata(pdev, mmc);
1321 1322
1322 host = mmc_priv(mmc); 1323 host = mmc_priv(mmc);
1323 host->dev = &pdev->dev; 1324 host->dev = &pdev->dev;
@@ -1384,7 +1385,6 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
1384 goto error_free_dma; 1385 goto error_free_dma;
1385 1386
1386 dev_info(&pdev->dev, "base:0x%p irq:%u\n", host->reg_base, host->irq); 1387 dev_info(&pdev->dev, "base:0x%p irq:%u\n", host->reg_base, host->irq);
1387 platform_set_drvdata(pdev, mmc);
1388 return 0; 1388 return 0;
1389 1389
1390error_free_dma: 1390error_free_dma: