-void i2c_reloc_fixup(void)
-{
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- struct i2c_adapter *i2c_adap_p = ll_entry_start(struct i2c_adapter,
- i2c);
- struct i2c_adapter *tmp = i2c_adap_p;
- int max = ll_entry_count(struct i2c_adapter, i2c);
- int i;
- unsigned long addr;
-
- if (gd->reloc_off == 0)
- return;
-
- for (i = 0; i < max; i++) {
- /* adapter itself */
- addr = (unsigned long)i2c_adap_p;
- addr += gd->reloc_off;
- i2c_adap_p = (struct i2c_adapter *)addr;
- /* i2c_init() */
- addr = (unsigned long)i2c_adap_p->init;
- addr += gd->reloc_off;
- i2c_adap_p->init = (void (*)(int, int))addr;
- /* i2c_probe() */
- addr = (unsigned long)i2c_adap_p->probe;
- addr += gd->reloc_off;
- i2c_adap_p->probe = (int (*)(uint8_t))addr;
- /* i2c_read() */
- addr = (unsigned long)i2c_adap_p->read;
- addr += gd->reloc_off;
- i2c_adap_p->read = (int (*)(uint8_t, uint, int, uint8_t *,
- int))addr;
- /* i2c_write() */
- addr = (unsigned long)i2c_adap_p->write;
- addr += gd->reloc_off;
- i2c_adap_p->write = (int (*)(uint8_t, uint, int, uint8_t *,
- int))addr;
- /* i2c_set_bus_speed() */
- addr = (unsigned long)i2c_adap_p->set_bus_speed;
- addr += gd->reloc_off;
- i2c_adap_p->set_bus_speed = (uint (*)(uint))addr;
- /* name */
- addr = (unsigned long)i2c_adap_p->name;
- addr += gd->reloc_off;
- i2c_adap_p->name = (char *)addr;
- tmp++;
- i2c_adap_p = tmp;
- }
-#endif
-}
-