[U-Boot] [PATCH v7 56/87] spi_flash: Use spi_flash_t

Jagan Teki jteki at openedev.com
Tue Mar 22 08:38:08 CET 2016


Use spi_flash_t instead of struct spi_flash.

Cc: Simon Glass <sjg at chromium.org>
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Mugunthan V N <mugunthanvnm at ti.com>
Cc: Michal Simek <michal.simek at xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
Signed-off-by: Jagan Teki <jteki at openedev.com>
---
 board/Arcturus/ucp1020/cmd_arc.c         | 2 +-
 board/Synology/ds414/cmd_syno.c          | 2 +-
 board/buffalo/lsxl/lsxl.c                | 2 +-
 board/congatec/cgtqmx6eval/cgtqmx6eval.c | 2 +-
 board/davinci/da8xxevm/da850evm.c        | 2 +-
 board/renesas/sh7752evb/sh7752evb.c      | 4 ++--
 board/renesas/sh7753evb/sh7753evb.c      | 4 ++--
 board/renesas/sh7757lcr/sh7757lcr.c      | 6 +++---
 board/siemens/taurus/taurus.c            | 2 +-
 common/splash_source.c                   | 2 +-
 drivers/dfu/dfu_sf.c                     | 4 ++--
 drivers/net/fm/fm.c                      | 2 +-
 drivers/net/phy/cortina.c                | 2 +-
 include/dfu.h                            | 2 +-
 14 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/board/Arcturus/ucp1020/cmd_arc.c b/board/Arcturus/ucp1020/cmd_arc.c
index fa6b485..9f98d6d 100644
--- a/board/Arcturus/ucp1020/cmd_arc.c
+++ b/board/Arcturus/ucp1020/cmd_arc.c
@@ -37,7 +37,7 @@
 #define FIRM_ADDR3 (CONFIG_ENV_SECT_SIZE + 0x200 - sizeof(smac))
 #define FIRM_ADDR4 (CONFIG_ENV_SECT_SIZE + 0x400 - sizeof(smac))
 
-static struct spi_flash *flash;
+static spi_flash_t *flash;
 char smac[4][18];
 
 static int ishwaddr(char *hwaddr)
diff --git a/board/Synology/ds414/cmd_syno.c b/board/Synology/ds414/cmd_syno.c
index 20544e2..1d0f3e7 100644
--- a/board/Synology/ds414/cmd_syno.c
+++ b/board/Synology/ds414/cmd_syno.c
@@ -27,7 +27,7 @@ static int do_syno_populate(int argc, char * const argv[])
 	unsigned int cs = CONFIG_SF_DEFAULT_CS;
 	unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
 	unsigned int mode = CONFIG_SF_DEFAULT_MODE;
-	struct spi_flash *flash;
+	spi_flash_t *flash;
 	unsigned long addr = 0x80000; /* XXX: parameterize this? */
 	loff_t offset = 0x007d0000;
 	loff_t len = 0x00010000;
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 0f37345..298d26e 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -211,7 +211,7 @@ void check_enetaddr(void)
 
 static void erase_environment(void)
 {
-	struct spi_flash *flash;
+	spi_flash_t *flash;
 
 	printf("Erasing environment..\n");
 	flash = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
diff --git a/board/congatec/cgtqmx6eval/cgtqmx6eval.c b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
index 225de7c..8db2b9e 100644
--- a/board/congatec/cgtqmx6eval/cgtqmx6eval.c
+++ b/board/congatec/cgtqmx6eval/cgtqmx6eval.c
@@ -1005,7 +1005,7 @@ static void conv_ascii(unsigned char *dst, unsigned char *src, int len)
 #define CFG_MFG_ADDR_OFFSET	(spi->size - SZ_16K)
 static bool is_2gb(void)
 {
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	int ret;
 	char buf[sizeof(struct mfgdata)];
 	struct mfgdata *data = (struct mfgdata *)buf;
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index b82385a..356d3ce 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -49,7 +49,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
 static int get_mac_addr(u8 *addr)
 {
-	struct spi_flash *flash;
+	spi_flash_t *flash;
 	int ret;
 
 	flash = spi_flash_probe(CFG_MAC_ADDR_SPI_BUS, CFG_MAC_ADDR_SPI_CS,
diff --git a/board/renesas/sh7752evb/sh7752evb.c b/board/renesas/sh7752evb/sh7752evb.c
index 3aad532..35360fd 100644
--- a/board/renesas/sh7752evb/sh7752evb.c
+++ b/board/renesas/sh7752evb/sh7752evb.c
@@ -185,7 +185,7 @@ int board_mmc_init(bd_t *bis)
 
 static int get_sh_eth_mac_raw(unsigned char *buf, int size)
 {
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	int ret;
 
 	spi = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
@@ -254,7 +254,7 @@ int do_write_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i, ret;
 	char mac_string[256];
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	unsigned char *buf;
 
 	if (argc != 3) {
diff --git a/board/renesas/sh7753evb/sh7753evb.c b/board/renesas/sh7753evb/sh7753evb.c
index 52a1906..8d609ec 100644
--- a/board/renesas/sh7753evb/sh7753evb.c
+++ b/board/renesas/sh7753evb/sh7753evb.c
@@ -201,7 +201,7 @@ int board_mmc_init(bd_t *bis)
 
 static int get_sh_eth_mac_raw(unsigned char *buf, int size)
 {
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	int ret;
 
 	spi = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
@@ -270,7 +270,7 @@ int do_write_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i, ret;
 	char mac_string[256];
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	unsigned char *buf;
 
 	if (argc != 3) {
diff --git a/board/renesas/sh7757lcr/sh7757lcr.c b/board/renesas/sh7757lcr/sh7757lcr.c
index ddcf275..9793f1f 100644
--- a/board/renesas/sh7757lcr/sh7757lcr.c
+++ b/board/renesas/sh7757lcr/sh7757lcr.c
@@ -30,7 +30,7 @@ static void init_gctrl(void)
 
 static int init_pcie_bridge_from_spi(void *buf, size_t size)
 {
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	int ret;
 	unsigned long pcie_addr;
 
@@ -256,7 +256,7 @@ int board_mmc_init(bd_t *bis)
 
 static int get_sh_eth_mac_raw(unsigned char *buf, int size)
 {
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	int ret;
 
 	spi = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
@@ -381,7 +381,7 @@ int do_write_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i, ret;
 	char mac_string[256];
-	struct spi_flash *spi;
+	spi_flash_t *spi;
 	unsigned char *buf;
 
 	if (argc != 5) {
diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index b0385d8..14907c8 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -121,7 +121,7 @@ void spl_board_init(void)
 
 	/* check for recovery mode */
 	if (at91_is_recovery() == 1) {
-		struct spi_flash *flash;
+		spi_flash_t *flash;
 
 		puts("Recovery button pressed\n");
 		nand_init();
diff --git a/common/splash_source.c b/common/splash_source.c
index a09dd4b..3393f73 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -20,7 +20,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 #ifdef CONFIG_SPI_FLASH
-static struct spi_flash *sf;
+static spi_flash_t *sf;
 static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
 {
 	if (!sf) {
diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
index 13e7f92..48eb546 100644
--- a/drivers/dfu/dfu_sf.c
+++ b/drivers/dfu/dfu_sf.c
@@ -63,14 +63,14 @@ static void dfu_free_entity_sf(struct dfu_entity *dfu)
 	spi_flash_free(dfu->data.sf.dev);
 }
 
-static struct spi_flash *parse_dev(char *devstr)
+static spi_flash_t *parse_dev(char *devstr)
 {
 	unsigned int bus;
 	unsigned int cs;
 	unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
 	unsigned int mode = CONFIG_SF_DEFAULT_MODE;
 	char *s, *endp;
-	struct spi_flash *dev;
+	spi_flash_t *dev;
 
 	s = strsep(&devstr, ":");
 	if (!s || !*s || (bus = simple_strtoul(s, &endp, 0), *endp)) {
diff --git a/drivers/net/fm/fm.c b/drivers/net/fm/fm.c
index e2a8ed3..9647ec1 100644
--- a/drivers/net/fm/fm.c
+++ b/drivers/net/fm/fm.c
@@ -367,7 +367,7 @@ int fm_init_common(int index, struct ccsr_fman *reg)
 			CONFIG_SYS_FMAN_FW_ADDR, rc);
 	}
 #elif defined(CONFIG_SYS_QE_FW_IN_SPIFLASH)
-	struct spi_flash *ucode_flash;
+	spi_flash_t *ucode_flash;
 	void *addr = malloc(CONFIG_SYS_QE_FMAN_FW_LENGTH);
 	int ret = 0;
 
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c
index f975fd8..f7961a4 100644
--- a/drivers/net/phy/cortina.c
+++ b/drivers/net/phy/cortina.c
@@ -147,7 +147,7 @@ void cs4340_upload_firmware(struct phy_device *phydev)
 	}
 #elif defined(CONFIG_SYS_CORTINA_FW_IN_SPIFLASH)
 	int ret;
-	struct spi_flash *ucode_flash;
+	spi_flash_t *ucode_flash;
 
 	addr = malloc(CONFIG_CORTINA_FW_LENGTH);
 	ucode_flash = spi_flash_probe(CONFIG_ENV_SPI_BUS, CONFIG_ENV_SPI_CS,
diff --git a/include/dfu.h b/include/dfu.h
index f39d3f1..28d263d 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -73,7 +73,7 @@ struct ram_internal_data {
 };
 
 struct sf_internal_data {
-	struct spi_flash *dev;
+	spi_flash_t *dev;
 
 	/* RAW programming */
 	u64 start;
-- 
1.9.1



More information about the U-Boot mailing list