Skip to contentSkip to conversation

EXYNOS: Resolve the i2c compilation error for

PATCH New amar_g 2 participants 2 messages Jul 10, 2013

Subsystems (2)
lore
Share & tools
lore

amar_g

author
#0 lore raw

PATCH v2 1/1 EXYNOS: Resolve the i2c compilation error for

This patch resolves the below mentioned compilation error of i2c driver for non-FDT case

Compilation error:
s3c24x0_i2c.c: In function 'board_i2c_init':
s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use in this function) s3c24x0_i2c.c:544:18: note: each undeclared identifier is reported only once for each function it appears in s3c24x0_i2c.c:545:3: warning: implicit declaration of function

---
Changes since V0:
1) Updated the below in response to review comments
a) Added the prefix 'EXYNOS' to title of the patch.

Changes since V1:
1) Updated the below in response to review comments
a) Limited info on "Compilation error" message for 5 lines.
b) Changed the spelling of 'mentiond' to 'mentioned'.

 board/samsung/smdk5250/smdk5250.c |   10 ++++++++++
 drivers/i2c/s3c24x0_i2c.c         |    9 +--------
 2 files changed, 11 insertions(+), 8 deletions(-)
board/samsung/smdk5250/smdk5250.c +10 -0
index ae1f077..f1d3d97 100644
@@ -332,6 +332,16 @@ static int board_uart_init(void)
 	return ret;
 }
 
+void board_i2c_init(const void *blob)
+{
+	int i;
+
+	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
+		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
+				     PINMUX_FLAG_NONE);
+	}
+}
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
drivers/i2c/s3c24x0_i2c.c +1 -8
index 3fc1c5b..382e4c2 100644
@@ -515,10 +515,10 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 		 len) != 0);
 }
 
+#ifdef CONFIG_OF_CONTROL
 void board_i2c_init(const void *blob)
 {
 	int i;
-#ifdef CONFIG_OF_CONTROL
 	int node_list[CONFIG_MAX_I2C_NUM];
 	int count;
 
@@ -540,15 +540,8 @@ void board_i2c_init(const void *blob)
 		bus->bus_num = i2c_busses++;
 		exynos_pinmux_config(bus->id, 0);
 	}
-#else
-	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
-		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
-				     PINMUX_FLAG_NONE);
-	}
-#endif
 }
 
-#ifdef CONFIG_OF_CONTROL
 static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
 {
 	if (bus_idx < i2c_busses)
Signature · 1 line
1.7.3.rc2
#1 lore raw

PATCH v2 1/1 EXYNOS: Resolve the i2c compilation error for

Quoted 17 lines · amar_g

This patch resolves the below mentioned compilation error of i2c driver for non-FDT case

Compilation error:
s3c24x0_i2c.c: In function 'board_i2c_init':
s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use in this function) s3c24x0_i2c.c:544:18: note: each undeclared identifier is reported only once for each function it appears in s3c24x0_i2c.c:545:3: warning: implicit declaration of function

---
Changes since V0:
1) Updated the below in response to review comments
a) Added the prefix 'EXYNOS' to title of the patch.

Quoted 9 lines

Changes since V1:
1) Updated the below in response to review comments
a) Limited info on "Compilation error" message for 5 lines.
b) Changed the spelling of 'mentiond' to 'mentioned'.

 board/samsung/smdk5250/smdk5250.c |   10 ++++++++++
 drivers/i2c/s3c24x0_i2c.c         |    9 +--------
 2 files changed, 11 insertions(+), 8 deletions(-)

applied to u-boot-samsung.

Thanks,
Minkyu Kang.