Commit c7eabbee authored by Wang Dongsheng's avatar Wang Dongsheng Committed by Ulf Hansson

sdhci: acpi: add free_slot callback

The device specific resource can be free in free_slot after
removing host controller.
Signed-off-by: default avatarWang Dongsheng <dongsheng.wang@hxt-semitech.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent b1f378ab
...@@ -76,6 +76,7 @@ struct sdhci_acpi_slot { ...@@ -76,6 +76,7 @@ struct sdhci_acpi_slot {
size_t priv_size; size_t priv_size;
int (*probe_slot)(struct platform_device *, const char *, const char *); int (*probe_slot)(struct platform_device *, const char *, const char *);
int (*remove_slot)(struct platform_device *); int (*remove_slot)(struct platform_device *);
int (*free_slot)(struct platform_device *pdev);
int (*setup_host)(struct platform_device *pdev); int (*setup_host)(struct platform_device *pdev);
}; };
...@@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) ...@@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
err_cleanup: err_cleanup:
sdhci_cleanup_host(c->host); sdhci_cleanup_host(c->host);
err_free: err_free:
if (c->slot && c->slot->free_slot)
c->slot->free_slot(pdev);
sdhci_free_host(c->host); sdhci_free_host(c->host);
return err; return err;
} }
...@@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) ...@@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev)
dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0);
sdhci_remove_host(c->host, dead); sdhci_remove_host(c->host, dead);
if (c->slot && c->slot->free_slot)
c->slot->free_slot(pdev);
sdhci_free_host(c->host); sdhci_free_host(c->host);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment