From caa4daa2ae3dc0a3e516addea5772c9af76abcb0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:18 -0700 Subject: dm: treewide: Rename 'platdata' variables to just 'plat' We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass --- cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/pci.c') diff --git a/cmd/pci.c b/cmd/pci.c index f91a4eb8ed0..628579a0d7f 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -341,7 +341,7 @@ static void pciinfo(struct udevice *bus, bool short_listing) device_find_next_child(&dev)) { struct pci_child_platdata *pplat; - pplat = dev_get_parent_platdata(dev); + pplat = dev_get_parent_plat(dev); if (short_listing) { printf("%02x.%02x.%02x ", bus->seq, PCI_DEV(pplat->devfn), PCI_FUNC(pplat->devfn)); -- cgit v1.2.3 From 8a8d24bdf174851ebb8607f359d54b72e3283b97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:23 -0700 Subject: dm: treewide: Rename ..._platdata variables to just ..._plat Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass --- cmd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/pci.c') diff --git a/cmd/pci.c b/cmd/pci.c index 628579a0d7f..2295cc5e8e8 100644 --- a/cmd/pci.c +++ b/cmd/pci.c @@ -339,7 +339,7 @@ static void pciinfo(struct udevice *bus, bool short_listing) for (device_find_first_child(bus, &dev); dev; device_find_next_child(&dev)) { - struct pci_child_platdata *pplat; + struct pci_child_plat *pplat; pplat = dev_get_parent_plat(dev); if (short_listing) { -- cgit v1.2.3 From 8b85dfc675f12de8d04126c07f3c796965b990c2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 16 Dec 2020 21:20:07 -0700 Subject: 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 --- cmd/pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd/pci.c') 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); } -- cgit v1.2.3