summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-spear.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2015-03-04 16:57:44 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-23 16:13:45 +0300
commitbbd7f0a20f76d079199d6d749cb3da07d345bae3 (patch)
tree9424dd7e0594bf68219ec88a9613b50648d80e04 /drivers/mmc/host/sdhci-spear.c
parent83f13cc9af9822cacc6644ee3c63c81f3930ddad (diff)
downloadlinux-bbd7f0a20f76d079199d6d749cb3da07d345bae3.tar.xz
mmc: sdhci-spear: Simplify by adding build dependency to CONFIG_OF
This driver is used on SoCs which are using CONFIG_OF. By adding a compile dependency in the Kconfig, it enables us to simplify some code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-spear.c')
-rw-r--r--drivers/mmc/host/sdhci-spear.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 22e58268545f..f482f7f677e5 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -44,7 +44,6 @@ static const struct sdhci_ops sdhci_pltfm_ops = {
.set_uhs_signaling = sdhci_set_uhs_signaling,
};
-#ifdef CONFIG_OF
static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -66,16 +65,9 @@ static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pde
return pdata;
}
-#else
-static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev)
-{
- return ERR_PTR(-ENOSYS);
-}
-#endif
static int sdhci_probe(struct platform_device *pdev)
{
- struct device_node *np = pdev->dev.of_node;
struct sdhci_host *host;
struct resource *iomem;
struct spear_sdhci *sdhci;
@@ -124,14 +116,10 @@ static int sdhci_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n",
clk_get_rate(sdhci->clk));
- if (np) {
- sdhci->data = sdhci_probe_config_dt(pdev);
- if (IS_ERR(sdhci->data)) {
- dev_err(&pdev->dev, "DT: Failed to get pdata\n");
- goto disable_clk;
- }
- } else {
- sdhci->data = dev_get_platdata(&pdev->dev);
+ sdhci->data = sdhci_probe_config_dt(pdev);
+ if (IS_ERR(sdhci->data)) {
+ dev_err(&pdev->dev, "DT: Failed to get pdata\n");
+ goto disable_clk;
}
/*