X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fmmc%2Fexynos_dw_mmc.c;h=e40575e58922a1449d4e09aad9d999dec03df43b;hb=31f044bd91df58bed6bb8cfadfc187eedac1442e;hp=283befccfbe6ceca869b4cc51c1df0628570aaa1;hpb=4711e7f7af839b41a6d78490257a9e7975494dd3;p=oweals%2Fu-boot.git diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 283befccfb..e40575e589 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -10,12 +10,12 @@ #include #include #include +#include #include #include #include #include #include -#include #define DWMMC_MAX_CH_NUM 4 #define DWMMC_MAX_FREQ 52000000 @@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, priv = malloc(sizeof(struct dwmci_exynos_priv_data)); if (!priv) { - error("dwmci_exynos_priv_data malloc fail!\n"); + pr_err("dwmci_exynos_priv_data malloc fail!\n"); return -ENOMEM; } @@ -168,6 +168,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, if (host->dev_index > 4) { printf("DWMMC%d: Can't get the dev index\n", host->dev_index); + free(priv); return -EINVAL; } @@ -178,6 +179,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, base = fdtdec_get_addr(blob, node, "reg"); if (!base) { printf("DWMMC%d: Can't get base address\n", host->dev_index); + free(priv); return -EINVAL; } host->ioaddr = (void *)base; @@ -187,6 +189,7 @@ static int exynos_dwmci_get_config(const void *blob, int node, if (err) { printf("DWMMC%d: Can't get sdr-timings for devider\n", host->dev_index); + free(priv); return -EINVAL; } @@ -264,15 +267,14 @@ static int exynos_dwmmc_probe(struct udevice *dev) struct dwmci_host *host = &priv->host; int err; - err = exynos_dwmci_get_config(gd->fdt_blob, dev->of_offset, host); + err = exynos_dwmci_get_config(gd->fdt_blob, dev_of_offset(dev), host); if (err) return err; err = do_dwmci_init(host); if (err) return err; - dwmci_setup_cfg(&plat->cfg, host->name, host->buswidth, host->caps, - DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); + dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ); host->mmc = &plat->mmc; host->mmc->priv = &priv->host; host->priv = dev; @@ -284,13 +286,8 @@ static int exynos_dwmmc_probe(struct udevice *dev) static int exynos_dwmmc_bind(struct udevice *dev) { struct exynos_mmc_plat *plat = dev_get_platdata(dev); - int ret; - ret = dwmci_bind(dev, &plat->mmc, &plat->cfg); - if (ret) - return ret; - - return 0; + return dwmci_bind(dev, &plat->mmc, &plat->cfg); } static const struct udevice_id exynos_dwmmc_ids[] = {