From f4552dd0e3c3e48e93b96483382811fc9bfea566 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 24 Feb 2020 15:47:42 +0900 Subject: [PATCH] mmc: exynos_dw_mmc: remove unused code Remove unused code and fix wrong memory allocation. - When rebased on v2019.10, it was applied wrong. Change-Id: I6cc953c511d01ce42c33bf8d461e7bf5629c6428 Signed-off-by: Jaehoon Chung --- drivers/mmc/exynos_dw_mmc.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 2a32bbe..360ac5f 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -142,43 +142,7 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) #endif return 0; } -#ifndef CONFIG_TPL_TM2 -/* - * This function adds the mmc channel to be registered with mmc core. - * index - mmc channel number. - * regbase - register base address of mmc channel specified in 'index'. - * bus_width - operating bus width of mmc channel specified in 'index'. - * clksel - value to be written into CLKSEL register in case of FDT. - * NULL in case od non-FDT. - */ -int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32 clksel) -{ - struct dwmci_host *host = NULL; - struct dwmci_exynos_priv_data *priv; - - host = malloc(sizeof(struct dwmci_host)); - if (!host) { - printk("dwmci_host malloc fail!\n"); - return -ENOMEM; - } - - priv = malloc(sizeof(struct dwmci_exynos_priv_data)); - if (!priv) { - printk("dwmci_exynos_priv_data malloc fail!\n"); - return -ENOMEM; - } - - host->ioaddr = (void *)regbase; - host->buswidth = bus_width; - - if (clksel) - priv->sdr_timing = clksel; - - host->priv = priv; - return 0; -} -#endif /* CONFIG_TPL_TM2" */ static struct dwmci_host dwmci_host[DWMMC_MAX_CH_NUM]; static int do_dwmci_init(struct dwmci_host *host) @@ -204,12 +168,6 @@ static int exynos_dwmci_get_config(const void *blob, int node, u32 timing[3]; dma_addr_t base; - priv = malloc(sizeof(struct dwmci_exynos_priv_data)); - if (!priv) { - pr_err("dwmci_exynos_priv_data malloc fail!\n"); - return -ENOMEM; - } - /* Extract device id for each mmc channel */ #ifndef CONFIG_TPL_TM2 host->dev_id = pinmux_decode_periph_id(blob, node); -- 2.7.4