diff options
| author | Simon Glass <[email protected]> | 2020-12-16 21:20:07 -0700 |
|---|---|---|
| committer | Simon Glass <[email protected]> | 2020-12-18 20:32:21 -0700 |
| commit | 8b85dfc675f12de8d04126c07f3c796965b990c2 (patch) | |
| tree | 9b8d6df956b02734a1b910b0a4c072e1e80b672a /cmd | |
| parent | 0b2fa98aa5e5dbdac4f5e2b2f67a34cc34dcc6b8 (diff) | |
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 <[email protected]>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/axi.c | 4 | ||||
| -rw-r--r-- | cmd/cpu.c | 2 | ||||
| -rw-r--r-- | cmd/i2c.c | 4 | ||||
| -rw-r--r-- | cmd/misc.c | 2 | ||||
| -rw-r--r-- | cmd/osd.c | 4 | ||||
| -rw-r--r-- | cmd/pci.c | 7 | ||||
| -rw-r--r-- | cmd/pmic.c | 4 | ||||
| -rw-r--r-- | cmd/remoteproc.c | 2 | ||||
| -rw-r--r-- | cmd/w1.c | 4 |
9 files changed, 17 insertions, 16 deletions
diff --git a/cmd/axi.c b/cmd/axi.c index c9d53c049e8..f7e206c04a7 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 a26234a659e..67dbb044b53 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 dc4b66da202..ac384550016 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 653deed7f57..ef540e836f2 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 bdad5d8e963..9b8fd5c921e 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 2295cc5e8e8..e53b7c858c6 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 3bda0534a36..0cb44d07409 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 02d44d4f0a9..5f9ba925609 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 " : "", @@ -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) |
