Commit 7d3ef4fa20a048008b979466f1326992aadad8ce
Exists in
master
and in
54 other branches
Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx
Showing 1 changed file Side-by-side Diff
cpu/ppc4xx/i2c.c
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | |
94 | 94 | void i2c_init(int speed, int slaveaddr) |
95 | 95 | { |
96 | - struct ppc4xx_i2c *i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR; | |
96 | + struct ppc4xx_i2c *i2c; | |
97 | 97 | int val, divisor; |
98 | 98 | int bus; |
99 | 99 | |
... | ... | @@ -108,6 +108,9 @@ |
108 | 108 | |
109 | 109 | for (bus = 0; bus < CONFIG_SYS_MAX_I2C_BUS; bus++) { |
110 | 110 | I2C_SET_BUS(bus); |
111 | + | |
112 | + /* Set i2c pointer after calling I2C_SET_BUS() */ | |
113 | + i2c = (struct ppc4xx_i2c *)I2C_BASE_ADDR; | |
111 | 114 | |
112 | 115 | /* Handle possible failed I2C state */ |
113 | 116 | /* FIXME: put this into i2c_init_board()? */ |