summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-09-17 16:09:54 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-10-26 17:59:57 +0300
commite02b9d7cbfe1536aef9e7ba7751993d7eca6e829 (patch)
treec84f31e8bd21af3fd4e96b60a4635c47e70c8e97 /drivers/mmc/host/sdhci-pltfm.c
parentbf7241d02eb4704beeaa055cb027ba7b28344a0e (diff)
downloadlinux-e02b9d7cbfe1536aef9e7ba7751993d7eca6e829.tar.xz
mmc: sdhci-pltfm: Use of_property_read_u32 instead of open-coding it
Use of_property_read_u32 instead of of_get_property with return value checks and endianness conversion. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pltfm.c')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index a207f5aaf62f..87fb5ea8ebe7 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -71,9 +71,7 @@ void sdhci_get_of_property(struct platform_device *pdev)
struct device_node *np = pdev->dev.of_node;
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- const __be32 *clk;
u32 bus_width;
- int size;
if (of_get_property(np, "sdhci,auto-cmd12", NULL))
host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
@@ -101,9 +99,7 @@ void sdhci_get_of_property(struct platform_device *pdev)
of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
- clk = of_get_property(np, "clock-frequency", &size);
- if (clk && size == sizeof(*clk) && *clk)
- pltfm_host->clock = be32_to_cpup(clk);
+ of_property_read_u32(np, "clock-frequency", &pltfm_host->clock);
if (of_find_property(np, "keep-power-in-suspend", NULL))
host->mmc->pm_caps |= MMC_PM_KEEP_POWER;