From a866ee23062c925b069476d32f7f7d40be279860 Mon Sep 17 00:00:00 2001 From: lin tao Date: Mon, 16 Jun 2014 15:46:50 +0800 Subject: [PATCH] mmc: remove unused macro tag --- drivers/mmc/host/Makefile | 2 +- drivers/mmc/host/dw_mmc-rockchip.c | 23 +------ drivers/mmc/host/rk_sdmmc.c | 2 +- drivers/mmc/host/rk_sdmmc.h | 2 +- drivers/mmc/host/rk_sdmmc_dbg.c | 16 +++++ .../host/{rk_sdmmc_of.h => rk_sdmmc_dbg.h} | 19 +----- drivers/mmc/host/rk_sdmmc_of.c | 62 ------------------- 7 files changed, 22 insertions(+), 104 deletions(-) create mode 100755 drivers/mmc/host/rk_sdmmc_dbg.c rename drivers/mmc/host/{rk_sdmmc_of.h => rk_sdmmc_dbg.h} (90%) delete mode 100755 drivers/mmc/host/rk_sdmmc_of.c diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile index 82c471324ca8..d4034e98af83 100755 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -46,7 +46,7 @@ obj-$(CONFIG_MMC_DW) += rk_sdmmc.o obj-$(CONFIG_MMC_DW_PLTFM) += dw_mmc-pltfm.o # To Specific Extensions for Synopsys DW Multimedia Card Interface in Rockchip Soc. Added by XBW. -obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_of.o rk_sdmmc_ops.o +obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o rk_sdmmc_dbg.o rk_sdmmc_ops.o obj-$(CONFIG_MMC_DW_EXYNOS) += dw_mmc-exynos.o obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index 9982c2807d09..e1b5d418f18e 100755 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -24,7 +24,7 @@ #include "dw_mmc-pltfm.h" #include "../../clk/rockchip/clk-ops.h" -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" /*CRU SDMMC TUNING*/ /* @@ -542,32 +542,11 @@ static const struct of_device_id dw_mci_rockchip_match[] = { }; MODULE_DEVICE_TABLE(of, dw_mci_rockchip_match); -#if DW_MMC_OF_PROBE -extern void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *mmc_property); -#endif - static int dw_mci_rockchip_probe(struct platform_device *pdev) { const struct dw_mci_drv_data *drv_data; const struct of_device_id *match; - #if DW_MMC_OF_PROBE - struct device_node *np = pdev->dev.of_node; - struct rk_sdmmc_of *rk_mmc_property = NULL; - - rk_mmc_property = (struct rk_sdmmc_of *)kmalloc(sizeof(struct rk_sdmmc_of),GFP_KERNEL); - if(NULL == rk_mmc_property) - { - kfree(rk_mmc_property); - rk_mmc_property = NULL; - printk("rk_mmc_property malloc space failed!\n"); - return 0; - } - - rockchip_mmc_of_probe(np,rk_mmc_property); - #endif /*DW_MMC_OF_PROBE*/ - - match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node); drv_data = match->data; return dw_mci_pltfm_register(pdev, drv_data); diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index a377af381310..52c706c109aa 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -44,7 +44,7 @@ #include #include "rk_sdmmc.h" -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" #include #include "../../clk/rockchip/clk-ops.h" diff --git a/drivers/mmc/host/rk_sdmmc.h b/drivers/mmc/host/rk_sdmmc.h index d506e28e87ba..bca5f992ee64 100755 --- a/drivers/mmc/host/rk_sdmmc.h +++ b/drivers/mmc/host/rk_sdmmc.h @@ -15,7 +15,7 @@ #ifndef _DW_MMC_H_ #define _DW_MMC_H_ -#include "rk_sdmmc_of.h" +#include "rk_sdmmc_dbg.h" #define DW_MMC_240A 0x240a diff --git a/drivers/mmc/host/rk_sdmmc_dbg.c b/drivers/mmc/host/rk_sdmmc_dbg.c new file mode 100755 index 000000000000..fdbe75df5184 --- /dev/null +++ b/drivers/mmc/host/rk_sdmmc_dbg.c @@ -0,0 +1,16 @@ +/* + * Synopsys DesignWare Multimedia Card Interface driver + * + * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include "rk_sdmmc_dbg.h" + +u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR; +char dbg_flag[]="mmc0mmc1mmc2"; + diff --git a/drivers/mmc/host/rk_sdmmc_of.h b/drivers/mmc/host/rk_sdmmc_dbg.h similarity index 90% rename from drivers/mmc/host/rk_sdmmc_of.h rename to drivers/mmc/host/rk_sdmmc_dbg.h index c18609b0e806..ed77964537a9 100755 --- a/drivers/mmc/host/rk_sdmmc_of.h +++ b/drivers/mmc/host/rk_sdmmc_dbg.h @@ -9,8 +9,8 @@ * (at your option) any later version. */ -#ifndef __RK_SDMMC_OF_H -#define __RK_SDMMC_OF_H +#ifndef __RK_SDMMC_DBG_H +#define __RK_SDMMC_DBG_H #include #include @@ -21,7 +21,6 @@ #define DRIVER_NAME "rk_sdmmc" #define DRIVER_PREFIX DRIVER_NAME ": " #define DRIVER_VER "Dw-mci-rockchip" -#define DW_MMC_OF_PROBE 0 enum MMC_DBG_MASK{ MMC_DBG_NONE = 0, @@ -113,18 +112,4 @@ extern char dbg_flag[]; } while (0) #endif -#if DW_MMC_OF_PROBE -struct rk_sdmmc_of -{ - u32 mmc_caps; - u32 mmc_int_type; - u32 mmc_ocr; - u32 mmc_dma_is_used[2]; /*Bit 1: use dma or not ; Bit 2:general dma or idma*/ - u32 emmc_is_selected; - u32 mmc_dma_chn; - const char *mmc_dma_name; - -}; -#endif /*DW_MMC_OF_PROBE*/ - #endif diff --git a/drivers/mmc/host/rk_sdmmc_of.c b/drivers/mmc/host/rk_sdmmc_of.c deleted file mode 100755 index 01a84d454a2e..000000000000 --- a/drivers/mmc/host/rk_sdmmc_of.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Synopsys DesignWare Multimedia Card Interface driver - * - * Copyright (C) 2014 Fuzhou Rockchip Electronics Co.Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ -#include "rk_sdmmc_of.h" - -u32 mmc_debug_level= MMC_DBG_BOOT|MMC_DBG_ERROR;//MMC_DBG_SW_VOL|MMC_DBG_CMD;//set the value refer to file rk_sdmmc_of.h -char dbg_flag[]="mmc0mmc1mmc2"; - -#if DW_MMC_OF_PROBE -static void rockchip_mmc_of_dump(struct rk_sdmmc_of *rk_mmc_property) -{ - printk("=========rockchip mmc dts dump info start== 2014-03-14 20:39 ======"); - mmc_debug(MMC_DBG_BOOT,"mmc,caps: 0x%x\n",rk_mmc_property->mmc_caps); - mmc_debug(MMC_DBG_BOOT,"mmc,ocr: 0x%x\n",rk_mmc_property->mmc_ocr); - mmc_debug(MMC_DBG_BOOT,"mmc,int: 0x%x\n",rk_mmc_property->mmc_int_type); - mmc_debug(MMC_DBG_BOOT,"mmc,emmc_is_selected: 0x%x\n",rk_mmc_property->emmc_is_selected); - mmc_debug(MMC_DBG_BOOT,"mmc,use_dma: %d %d\n",rk_mmc_property->mmc_dma_is_used[0], - rk_mmc_property->mmc_dma_is_used[1]); - mmc_debug(MMC_DBG_BOOT,"mmc,dma_ch: %d\n",rk_mmc_property->mmc_dma_chn); - mmc_debug(MMC_DBG_BOOT,"=========rockchip mmc dts dump info end================\n"); -} - - -void rockchip_mmc_of_probe(struct device_node *np,struct rk_sdmmc_of *rk_mmc_property) -{ - of_property_read_u32(np, "mmc,caps", &rk_mmc_property->mmc_caps); - of_property_read_u32(np, "mmc,ocr", &rk_mmc_property->mmc_ocr); - of_property_read_u32(np, "mmc,int", &rk_mmc_property->mmc_int_type); - of_property_read_u32(np, "mmc,emmc_is_selected", &rk_mmc_property->emmc_is_selected); - of_property_read_u32_array(np, "mmc,use_dma", rk_mmc_property->mmc_dma_is_used,2); -/* - if((&rk_mmc_property->mmc_dma_is_used[0] == MMC_USE_DMA)) - { - if(rk_mmc_property->mmc_dma_is_used[1] == 0) - rk_mmc_property->mmc_dma_name = "dma_mmc0"; - else if(rk_mmc_property->mmc_dma_is_used[1] == 1) - rk_mmc_property->mmc_dma_name = "dma_mmc1"; - else - rk_mmc_property->mmc_dma_name = "dma_mmc2"; - - //of_property_read_string(np, "mmc,dma_name", &(rk_mmc_property->mmc_dma_name)); - of_property_read_u32(np, "mmc,dma_ch", &rk_mmc_property->mmc_dma_chn); - - }else{ - mmc_debug(MMC_DBG_WARN,"Device Tree configure mmc drivers to use pio!\n"); - } - */ - rockchip_mmc_of_dump(rk_mmc_property); - return ; - -} -EXPORT_SYSMBOL(rockchip_mmc_of_probe); -#endif /*DW_MMC_OF_PROBE*/ - - -- 2.34.1