
On Wednesday 18 January 2012 15:11:56 Tabi Timur-B04825 wrote:
On Tue, Jan 17, 2012 at 1:12 AM, Simon Glass wrote:
--- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -87,6 +87,9 @@ typedef struct global_data { unsigned long post_log_res; /* success of POST test */ unsigned long post_init_f_time; /* When post_init_f started */ #endif +#if defined(CONFIG_SYS_I2C)
void *cur_adap; /* current used i2c adapter */
+#endif
I was really hoping we could get rid of the concept of a "current" i2c adapter, and just force all drivers to specify the I2C adapter they want to use for a given I2C operation. That's how Linux operates, and it will prevent stuff like this:
void *old; void *new;
old = get_current_i2c_adapter(); set_i2c_adapter(new); // do I2C stuff set_i2c_adapter(old);
that's only needed if you expect the pointer to stay valid across calls. i don't think it does for most (all?) drivers. -mike