From 41a5c481947d6c526bec8225596ebf98807f9c50 Mon Sep 17 00:00:00 2001 From: Troy Kisky <troy.kisky@boundarydevices.com> Date: Mon, 7 Aug 2017 15:13:03 -0700 Subject: [PATCH] i2c-mxv7: setup_i2c to take a const struct i2c_pads_info Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> --- arch/arm/include/asm/mach-imx/mxc_i2c.h | 10 +++++----- arch/arm/mach-imx/i2c-mxv7.c | 6 +++--- drivers/i2c/mxc_i2c.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/include/asm/mach-imx/mxc_i2c.h b/arch/arm/include/asm/mach-imx/mxc_i2c.h index 95d2cb41b2c..0d0248e1566 100644 --- a/arch/arm/include/asm/mach-imx/mxc_i2c.h +++ b/arch/arm/include/asm/mach-imx/mxc_i2c.h @@ -50,8 +50,8 @@ struct mxc_i2c_bus { int speed; struct i2c_pads_info *pads_info; #ifndef CONFIG_DM_I2C - int (*idle_bus_fn)(void *p); - void *idle_bus_data; + int (*idle_bus_fn)(const void *p); + const void *idle_bus_data; #else struct udevice *bus; /* Use gpio to force bus idle when bus state is abnormal */ @@ -167,10 +167,10 @@ struct mxc_i2c_bus { #endif int setup_i2c(unsigned i2c_index, int speed, int slave_addr, - struct i2c_pads_info *p); + const struct i2c_pads_info *p); void bus_i2c_init(int index, int speed, int slave_addr, - int (*idle_bus_fn)(void *p), void *p); -int force_idle_bus(void *priv); + int (*idle_bus_fn)(const void *p), const void *p); +int force_idle_bus(const void *priv); int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus); static inline int i2c_get_info_entry_offset(void) { diff --git a/arch/arm/mach-imx/i2c-mxv7.c b/arch/arm/mach-imx/i2c-mxv7.c index 814d834b164..72e4c68acaf 100644 --- a/arch/arm/mach-imx/i2c-mxv7.c +++ b/arch/arm/mach-imx/i2c-mxv7.c @@ -11,12 +11,12 @@ #include <asm/mach-imx/mxc_i2c.h> #include <watchdog.h> -int force_idle_bus(void *priv) +int force_idle_bus(const void *priv) { int i; int sda, scl; ulong elapsed, start_time; - struct i2c_pads_info *p = (struct i2c_pads_info *)priv; + const struct i2c_pads_info *p = (struct i2c_pads_info *)priv; int ret = 0; gpio_direction_input(p->sda.gp); @@ -73,7 +73,7 @@ static void * const i2c_bases[] = { /* i2c_index can be from 0 - 3 */ int setup_i2c(unsigned i2c_index, int speed, int slave_addr, - struct i2c_pads_info *p) + const struct i2c_pads_info *p) { char name[9]; int ret; diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index 9999d9fe5e4..e2793aa84d4 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -662,7 +662,7 @@ int enable_i2c_clk(unsigned char enable, unsigned i2c_num) __attribute__((weak, alias("__enable_i2c_clk"))); void bus_i2c_init(int index, int speed, int unused, - int (*idle_bus_fn)(void *p), void *idle_bus_data) + int (*idle_bus_fn)(const void *p), const void *idle_bus_data) { int ret; -- GitLab