From b11f53f31b97536c74d75e7678ad7a363a9537da Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 15 Mar 2011 16:52:29 +0100 Subject: keymile: Fix Coding style issues for keymile boards. - use I/O accessors -> For accessing the FPGA therefore a struct km_bec_fpga is introduced. - no longer externs needed - to defines, that only select functions, don;t assign a numeric value - Codingstyle changes to prevent checkpatch errors/warnings Signed-off-by: Heiko Schocher Acked-by: Kim Phillips cc: Kim Phillips cc: Holger Brunck cc: Wolfgang Denk cc: Detlev Zundel cc: Valentin Longchamp cc: Prafulla Wadaskar --- board/keymile/km_arm/km_arm.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'board/keymile/km_arm') diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c index bf03f0c..7c43475 100644 --- a/board/keymile/km_arm/km_arm.c +++ b/board/keymile/km_arm/km_arm.c @@ -108,12 +108,12 @@ int ethernet_present(void) int ret = 0; if (i2c_read(0x10, 2, 1, &buf, 1) != 0) { - printf ("%s: Error reading Boco\n", __FUNCTION__); + printf("%s: Error reading Boco\n", __func__); return -1; } - if ((buf & 0x40) == 0x40) { + if ((buf & 0x40) == 0x40) ret = 1; - } + return ret; } @@ -258,15 +258,15 @@ void reset_phy(void) } #if defined(CONFIG_HUSH_INIT_VAR) -int hush_init_var (void) +int hush_init_var(void) { - ivm_read_eeprom (); + ivm_read_eeprom(); return 0; } #endif #if defined(CONFIG_BOOTCOUNT_LIMIT) -void bootcount_store (ulong a) +void bootcount_store(ulong a) { volatile ulong *save_addr; volatile ulong size = 0; @@ -279,7 +279,7 @@ void bootcount_store (ulong a) writel(BOOTCOUNT_MAGIC, &save_addr[1]); } -ulong bootcount_load (void) +ulong bootcount_load(void) { volatile ulong *save_addr; volatile ulong size = 0; @@ -296,31 +296,31 @@ ulong bootcount_load (void) #endif #if defined(CONFIG_SOFT_I2C) -void set_sda (int state) +void set_sda(int state) { I2C_ACTIVE; I2C_SDA(state); } -void set_scl (int state) +void set_scl(int state) { I2C_SCL(state); } -int get_sda (void) +int get_sda(void) { I2C_TRISTATE; return I2C_READ; } -int get_scl (void) +int get_scl(void) { return (kw_gpio_get_value(SUEN3_SCL_PIN) ? 1 : 0); } #endif #if defined(CONFIG_SYS_EEPROM_WREN) -int eeprom_write_enable (unsigned dev_addr, int state) +int eeprom_write_enable(unsigned dev_addr, int state) { kw_gpio_set_value(SUEN3_ENV_WP, !state); -- cgit v1.1