1 |
From 16fb7917d8724f1d0cabfa19777559974847b2e7 Mon Sep 17 00:00:00 2001 |
2 |
From: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> |
3 |
Date: Thu, 16 Aug 2018 12:48:42 +0800 |
4 |
Subject: [PATCH 025/145] sdhci: acpi: add free_slot callback |
5 |
|
6 |
[ Upstream commit c7eabbee3de99347105faa7fd925a500ccf43baf ] |
7 |
|
8 |
The device specific resource can be free in free_slot after |
9 |
removing host controller. |
10 |
|
11 |
Signed-off-by: Wang Dongsheng <dongsheng.wang@hxt-semitech.com> |
12 |
Acked-by: Adrian Hunter <adrian.hunter@intel.com> |
13 |
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> |
14 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
15 |
--- |
16 |
drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ |
17 |
1 file changed, 8 insertions(+) |
18 |
|
19 |
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c |
20 |
index 32321bd596d8..c61109f7b793 100644 |
21 |
--- a/drivers/mmc/host/sdhci-acpi.c |
22 |
+++ b/drivers/mmc/host/sdhci-acpi.c |
23 |
@@ -76,6 +76,7 @@ struct sdhci_acpi_slot { |
24 |
size_t priv_size; |
25 |
int (*probe_slot)(struct platform_device *, const char *, const char *); |
26 |
int (*remove_slot)(struct platform_device *); |
27 |
+ int (*free_slot)(struct platform_device *pdev); |
28 |
int (*setup_host)(struct platform_device *pdev); |
29 |
}; |
30 |
|
31 |
@@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) |
32 |
err_cleanup: |
33 |
sdhci_cleanup_host(c->host); |
34 |
err_free: |
35 |
+ if (c->slot && c->slot->free_slot) |
36 |
+ c->slot->free_slot(pdev); |
37 |
+ |
38 |
sdhci_free_host(c->host); |
39 |
return err; |
40 |
} |
41 |
@@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) |
42 |
|
43 |
dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); |
44 |
sdhci_remove_host(c->host, dead); |
45 |
+ |
46 |
+ if (c->slot && c->slot->free_slot) |
47 |
+ c->slot->free_slot(pdev); |
48 |
+ |
49 |
sdhci_free_host(c->host); |
50 |
|
51 |
return 0; |
52 |
-- |
53 |
2.19.1 |
54 |
|