dm: Avoid accessing seq directly
At present various drivers etc. access the device's 'seq' member directly.
This makes it harder to change the meaning of that member. Change access
to go through a function instead.
The drivers/i2c/lpc32xx_i2c.c file is left unchanged for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c
index 7cb5e8b..1e74484 100644
--- a/drivers/i2c/tegra_i2c.c
+++ b/drivers/i2c/tegra_i2c.c
@@ -362,7 +362,7 @@
int ret;
bool is_dvc;
- i2c_bus->id = dev->seq;
+ i2c_bus->id = dev_seq(dev);
i2c_bus->type = dev_get_driver_data(dev);
i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev);
if ((ulong)i2c_bus->regs == FDT_ADDR_T_NONE) {
@@ -408,7 +408,8 @@
}
i2c_init_controller(i2c_bus);
debug("%s: controller bus %d at %p, speed %d: ",
- is_dvc ? "dvc" : "i2c", dev->seq, i2c_bus->regs, i2c_bus->speed);
+ is_dvc ? "dvc" : "i2c", dev_seq(dev), i2c_bus->regs,
+ i2c_bus->speed);
return 0;
}