aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-16 21:20:07 -0700
committerSimon Glass <sjg@chromium.org>2020-12-18 20:32:21 -0700
commit8b85dfc675f12de8d04126c07f3c796965b990c2 (patch)
tree9b8d6df956b02734a1b910b0a4c072e1e80b672a /cmd
parent0b2fa98aa5e5dbdac4f5e2b2f67a34cc34dcc6b8 (diff)
downloadu-boot-8b85dfc675f12de8d04126c07f3c796965b990c2.zip
u-boot-8b85dfc675f12de8d04126c07f3c796965b990c2.tar.gz
u-boot-8b85dfc675f12de8d04126c07f3c796965b990c2.tar.bz2
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>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/axi.c4
-rw-r--r--cmd/cpu.c2
-rw-r--r--cmd/i2c.c4
-rw-r--r--cmd/misc.c2
-rw-r--r--cmd/osd.c4
-rw-r--r--cmd/pci.c7
-rw-r--r--cmd/pmic.c4
-rw-r--r--cmd/remoteproc.c2
-rw-r--r--cmd/w1.c4
9 files changed, 17 insertions, 16 deletions
diff --git a/cmd/axi.c b/cmd/axi.c
index c9d53c0..f7e206c 100644
--- a/cmd/axi.c
+++ b/cmd/axi.c
@@ -35,7 +35,7 @@ static void show_bus(struct udevice *bus)
printf("Bus %d:\t%s", bus->req_seq, bus->name);
if (device_active(bus))
- printf(" (active %d)", bus->seq);
+ printf(" (active %d)", dev_seq(bus));
printf("\n");
for (device_find_first_child(bus, &dev);
dev;
@@ -147,7 +147,7 @@ static int do_axi_bus_num(struct cmd_tbl *cmdtp, int flag, int argc,
struct udevice *bus;
if (!axi_get_cur_bus(&bus))
- bus_no = bus->seq;
+ bus_no = dev_seq(bus);
else
bus_no = -1;
diff --git a/cmd/cpu.c b/cmd/cpu.c
index a26234a..67dbb04 100644
--- a/cmd/cpu.c
+++ b/cmd/cpu.c
@@ -32,7 +32,7 @@ static int print_cpu_list(bool detail)
int ret, i;
ret = cpu_get_desc(dev, buf, sizeof(buf));
- printf("%3d: %-10s %s\n", dev->seq, dev->name,
+ printf("%3d: %-10s %s\n", dev_seq(dev), dev->name,
ret ? "<no description>" : buf);
if (!detail)
continue;
diff --git a/cmd/i2c.c b/cmd/i2c.c
index dc4b66d..ac38455 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -1702,7 +1702,7 @@ static void show_bus(struct udevice *bus)
printf("Bus %d:\t%s", bus->req_seq, bus->name);
if (device_active(bus))
- printf(" (active %d)", bus->seq);
+ printf(" (active %d)", dev_seq(bus));
printf("\n");
for (device_find_first_child(bus, &dev);
dev;
@@ -1825,7 +1825,7 @@ static int do_i2c_bus_num(struct cmd_tbl *cmdtp, int flag, int argc,
struct udevice *bus;
if (!i2c_get_cur_bus(&bus))
- bus_no = bus->seq;
+ bus_no = dev_seq(bus);
else
bus_no = -1;
#else
diff --git a/cmd/misc.c b/cmd/misc.c
index 653deed..ef540e8 100644
--- a/cmd/misc.c
+++ b/cmd/misc.c
@@ -34,7 +34,7 @@ static int do_misc_list(struct cmd_tbl *cmdtp, int flag,
for (uclass_first_device(UCLASS_MISC, &dev);
dev;
uclass_next_device(&dev)) {
- printf("%-20s %5d %10s\n", dev->name, dev->seq,
+ printf("%-20s %5d %10s\n", dev->name, dev_seq(dev),
dev->driver->name);
}
diff --git a/cmd/osd.c b/cmd/osd.c
index bdad5d8..9b8fd5c 100644
--- a/cmd/osd.c
+++ b/cmd/osd.c
@@ -77,7 +77,7 @@ static void show_osd(struct udevice *osd)
{
printf("OSD %d:\t%s", osd->req_seq, osd->name);
if (device_active(osd))
- printf(" (active %d)", osd->seq);
+ printf(" (active %d)", dev_seq(osd));
printf("\n");
}
@@ -235,7 +235,7 @@ static int do_osd_num(struct cmd_tbl *cmdtp, int flag, int argc,
struct udevice *osd;
if (!osd_get_osd_cur(&osd))
- osd_no = osd->seq;
+ osd_no = dev_seq(osd);
else
osd_no = -1;
printf("Current osd is %d\n", osd_no);
diff --git a/cmd/pci.c b/cmd/pci.c
index 2295cc5..e53b7c8 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -334,7 +334,7 @@ static void pciinfo(struct udevice *bus, bool short_listing)
{
struct udevice *dev;
- pciinfo_header(bus->seq, short_listing);
+ pciinfo_header(dev_seq(bus), short_listing);
for (device_find_first_child(bus, &dev);
dev;
@@ -343,11 +343,12 @@ static void pciinfo(struct udevice *bus, bool short_listing)
pplat = dev_get_parent_plat(dev);
if (short_listing) {
- printf("%02x.%02x.%02x ", bus->seq,
+ printf("%02x.%02x.%02x ", dev_seq(bus),
PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn));
pci_header_show_brief(dev);
} else {
- printf("\nFound PCI device %02x.%02x.%02x:\n", bus->seq,
+ printf("\nFound PCI device %02x.%02x.%02x:\n",
+ dev_seq(bus),
PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn));
pci_header_show(dev);
}
diff --git a/cmd/pmic.c b/cmd/pmic.c
index 3bda053..0cb44d0 100644
--- a/cmd/pmic.c
+++ b/cmd/pmic.c
@@ -41,7 +41,7 @@ static int do_dev(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
return CMD_RET_USAGE;
}
- printf("dev: %d @ %s\n", currdev->seq, currdev->name);
+ printf("dev: %d @ %s\n", dev_seq(currdev), currdev->name);
}
return CMD_RET_SUCCESS;
@@ -66,7 +66,7 @@ static int do_list(struct cmd_tbl *cmdtp, int flag, int argc,
printf("| %-*.*s| %-*.*s| %s @ %d\n",
LIMIT_DEV, LIMIT_DEV, dev->name,
LIMIT_PARENT, LIMIT_PARENT, dev->parent->name,
- dev_get_uclass_name(dev->parent), dev->parent->seq);
+ dev_get_uclass_name(dev->parent), dev_seq(dev->parent));
}
if (ret)
diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c
index 02d44d4..5f9ba92 100644
--- a/cmd/remoteproc.c
+++ b/cmd/remoteproc.c
@@ -47,7 +47,7 @@ static int print_remoteproc_list(void)
break;
}
printf("%d - Name:'%s' type:'%s' supports: %s%s%s%s%s%s\n",
- dev->seq,
+ dev_seq(dev),
uc_pdata->name,
type,
ops->load ? "load " : "",
diff --git a/cmd/w1.c b/cmd/w1.c
index 459094b..d0f0ee1 100644
--- a/cmd/w1.c
+++ b/cmd/w1.c
@@ -21,7 +21,7 @@ static int w1_bus(void)
printf("one wire interface not found\n");
return CMD_RET_FAILURE;
}
- printf("Bus %d:\t%s", bus->seq, bus->name);
+ printf("Bus %d:\t%s", dev_seq(bus), bus->name);
if (device_active(bus))
printf(" (active)");
printf("\n");
@@ -31,7 +31,7 @@ static int w1_bus(void)
device_find_next_child(&dev)) {
ret = device_probe(dev);
- printf("\t%s (%d) uclass %s : ", dev->name, dev->seq,
+ printf("\t%s (%d) uclass %s : ", dev->name, dev_seq(dev),
dev->uclass->uc_drv->name);
if (ret)