]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
i2c: s3c24x0: fix the compiler error for exynos4
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 9 Jan 2017 05:47:51 +0000 (14:47 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 18 Jan 2017 04:25:56 +0000 (13:25 +0900)
If CONFIG_SYS_I2C_S3C24X0_SLAVE isn't defined, then complie error should
be occurred.
This patch is for preventing it.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/i2c/s3c24x0_i2c.c

index 2ece9f419591be3459b392442e316479cbce1372..363cd04e4e2692899b63bad0bbe46613861b6371 100644 (file)
 #include <i2c.h>
 #include "s3c24x0_i2c.h"
 
+#ifndef CONFIG_SYS_I2C_S3C24X0_SLAVE
+#define SYS_I2C_S3C24X0_SLAVE_ADDR     0
+#else
+#define SYS_I2C_S3C24X0_SLAVE_ADDR     CONFIG_SYS_I2C_S3C24X0_SLAVE
+#endif
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -87,7 +93,7 @@ static int s3c24x0_i2c_set_bus_speed(struct udevice *dev, unsigned int speed)
        i2c_bus->clock_frequency = speed;
 
        i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
-                   CONFIG_SYS_I2C_S3C24X0_SLAVE);
+                   SYS_I2C_S3C24X0_SLAVE_ADDR);
 
        return 0;
 }