diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2015-03-04 08:57:44 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-03-23 09:13:45 -0400 |
commit | bbd7f0a20f76d079199d6d749cb3da07d345bae3 (patch) | |
tree | 9424dd7e0594bf68219ec88a9613b50648d80e04 /drivers/mmc/host | |
parent | 83f13cc9af9822cacc6644ee3c63c81f3930ddad (diff) |
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')
-rw-r--r-- | drivers/mmc/host/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-spear.c | 20 |
2 files changed, 5 insertions, 16 deletions
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 2f850ac5fde9..7f4db908f89b 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -255,6 +255,7 @@ config MMC_SDHCI_PXAV2 | |||
255 | config MMC_SDHCI_SPEAR | 255 | config MMC_SDHCI_SPEAR |
256 | tristate "SDHCI support on ST SPEAr platform" | 256 | tristate "SDHCI support on ST SPEAr platform" |
257 | depends on MMC_SDHCI && PLAT_SPEAR | 257 | depends on MMC_SDHCI && PLAT_SPEAR |
258 | depends on OF | ||
258 | help | 259 | help |
259 | This selects the Secure Digital Host Controller Interface (SDHCI) | 260 | This selects the Secure Digital Host Controller Interface (SDHCI) |
260 | often referrered to as the HSMMC block in some of the ST SPEAR range | 261 | often referrered to as the HSMMC block in some of the ST SPEAR range |
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 = { | |||
44 | .set_uhs_signaling = sdhci_set_uhs_signaling, | 44 | .set_uhs_signaling = sdhci_set_uhs_signaling, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | #ifdef CONFIG_OF | ||
48 | static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) | 47 | static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) |
49 | { | 48 | { |
50 | struct device_node *np = pdev->dev.of_node; | 49 | 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 | |||
66 | 65 | ||
67 | return pdata; | 66 | return pdata; |
68 | } | 67 | } |
69 | #else | ||
70 | static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) | ||
71 | { | ||
72 | return ERR_PTR(-ENOSYS); | ||
73 | } | ||
74 | #endif | ||
75 | 68 | ||
76 | static int sdhci_probe(struct platform_device *pdev) | 69 | static int sdhci_probe(struct platform_device *pdev) |
77 | { | 70 | { |
78 | struct device_node *np = pdev->dev.of_node; | ||
79 | struct sdhci_host *host; | 71 | struct sdhci_host *host; |
80 | struct resource *iomem; | 72 | struct resource *iomem; |
81 | struct spear_sdhci *sdhci; | 73 | struct spear_sdhci *sdhci; |
@@ -124,14 +116,10 @@ static int sdhci_probe(struct platform_device *pdev) | |||
124 | dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", | 116 | dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", |
125 | clk_get_rate(sdhci->clk)); | 117 | clk_get_rate(sdhci->clk)); |
126 | 118 | ||
127 | if (np) { | 119 | sdhci->data = sdhci_probe_config_dt(pdev); |
128 | sdhci->data = sdhci_probe_config_dt(pdev); | 120 | if (IS_ERR(sdhci->data)) { |
129 | if (IS_ERR(sdhci->data)) { | 121 | dev_err(&pdev->dev, "DT: Failed to get pdata\n"); |
130 | dev_err(&pdev->dev, "DT: Failed to get pdata\n"); | 122 | goto disable_clk; |
131 | goto disable_clk; | ||
132 | } | ||
133 | } else { | ||
134 | sdhci->data = dev_get_platdata(&pdev->dev); | ||
135 | } | 123 | } |
136 | 124 | ||
137 | /* | 125 | /* |