summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-acpi.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2017-12-08 15:04:58 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2017-12-11 13:15:57 +0100
commit0cc1a0f4519e26d6498bd85c6e648b21a6cdd3ea (patch)
tree56e927a0b38b7f35759a16af6454c23e8241de7c /drivers/mmc/host/sdhci-acpi.c
parent2361bfb055f948eac6583fa3c75a014da84fe554 (diff)
downloadlinux-0cc1a0f4519e26d6498bd85c6e648b21a6cdd3ea.tar.gz
linux-0cc1a0f4519e26d6498bd85c6e648b21a6cdd3ea.tar.bz2
linux-0cc1a0f4519e26d6498bd85c6e648b21a6cdd3ea.zip
mmc: sdhci-acpi: Add setup_host() callback
Add a ->setup_host() callback so that device-specific changes can be made to the mmc host controller before it is added. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-acpi.c')
-rw-r--r--drivers/mmc/host/sdhci-acpi.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 1b1ce804d2d7..f7445cf8f7dd 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -76,6 +76,7 @@ struct sdhci_acpi_slot {
size_t priv_size;
int (*probe_slot)(struct platform_device *, const char *, const char *);
int (*remove_slot)(struct platform_device *);
+ int (*setup_host)(struct platform_device *pdev);
};
struct sdhci_acpi_host {
@@ -688,10 +689,20 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
}
}
- err = sdhci_add_host(host);
+ err = sdhci_setup_host(host);
if (err)
goto err_free;
+ if (c->slot && c->slot->setup_host) {
+ err = c->slot->setup_host(pdev);
+ if (err)
+ goto err_cleanup;
+ }
+
+ err = __sdhci_add_host(host);
+ if (err)
+ goto err_cleanup;
+
if (c->use_runtime_pm) {
pm_runtime_set_active(dev);
pm_suspend_ignore_children(dev, 1);
@@ -704,6 +715,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
return 0;
+err_cleanup:
+ sdhci_cleanup_host(c->host);
err_free:
sdhci_free_host(c->host);
return err;