diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2017-09-23 13:22:14 +0200 |
---|---|---|
committer | Marek Vasut <marek.vasut+renesas@gmail.com> | 2018-04-11 23:11:58 +0200 |
commit | 147169d9c9ed8d0e1ca6185c2e45677be9b18157 (patch) | |
tree | 1af02785be8e4bb6658df1a95c44f63f10d28eaa | |
parent | 7cf7ef81ed8b57194b5c4408c05963b664d44229 (diff) |
mmc: matsushita-common: Use mmc_of_parse()
Drop the ad-hoc DT caps parsing in favor of common framework function.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | drivers/mmc/matsushita-common.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/mmc/matsushita-common.c b/drivers/mmc/matsushita-common.c index 0b0cbaf9e1..449f533d1b 100644 --- a/drivers/mmc/matsushita-common.c +++ b/drivers/mmc/matsushita-common.c @@ -703,24 +703,15 @@ int matsu_sd_probe(struct udevice *dev, u32 quirks) return ret; } - plat->cfg.name = dev->name; - plat->cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS; - - switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width", - 1)) { - case 8: - plat->cfg.host_caps |= MMC_MODE_8BIT; - break; - case 4: - plat->cfg.host_caps |= MMC_MODE_4BIT; - break; - case 1: - break; - default: - dev_err(dev, "Invalid \"bus-width\" value\n"); - return -EINVAL; + ret = mmc_of_parse(dev, &plat->cfg); + if (ret < 0) { + dev_err(dev, "failed to parse host caps\n"); + return ret; } + plat->cfg.name = dev->name; + plat->cfg.host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS; + if (quirks) { priv->caps = quirks; } else { |