diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-22 19:30:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:40 -0700 |
commit | 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch) | |
tree | 1dbc5b936b98393e343cc99a40382b2734ac778e /drivers/pci | |
parent | 12559f5bab3e43b603dccfa6c354ffd7da03249c (diff) | |
download | u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.zip u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.tar.gz u-boot-0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d.tar.bz2 |
dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them.
In some cases the access is not permitted, so mark those with a FIXME tag
for the maintainer to check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-emul-uclass.c | 4 | ||||
-rw-r--r-- | drivers/pci/pci-uclass.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/pci-emul-uclass.c b/drivers/pci/pci-emul-uclass.c index 756d8ad..a0b8afb 100644 --- a/drivers/pci/pci-emul-uclass.c +++ b/drivers/pci/pci-emul-uclass.c @@ -82,7 +82,7 @@ uint sandbox_pci_read_bar(u32 barval, int type, uint size) static int sandbox_pci_emul_post_probe(struct udevice *dev) { - struct sandbox_pci_emul_priv *priv = dev->uclass->priv; + struct sandbox_pci_emul_priv *priv = uclass_get_priv(dev->uclass); priv->dev_count++; sandbox_set_enable_pci_map(true); @@ -92,7 +92,7 @@ static int sandbox_pci_emul_post_probe(struct udevice *dev) static int sandbox_pci_emul_pre_remove(struct udevice *dev) { - struct sandbox_pci_emul_priv *priv = dev->uclass->priv; + struct sandbox_pci_emul_priv *priv = uclass_get_priv(dev->uclass); priv->dev_count--; sandbox_set_enable_pci_map(priv->dev_count > 0); diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 914217d..37a2338 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -524,7 +524,7 @@ static void set_vga_bridge_bits(struct udevice *dev) int pci_auto_config_devices(struct udevice *bus) { - struct pci_controller *hose = bus->uclass_priv; + struct pci_controller *hose = dev_get_uclass_priv(bus); struct pci_child_plat *pplat; unsigned int sub_bus; struct udevice *dev; @@ -1007,7 +1007,7 @@ static int pci_uclass_pre_probe(struct udevice *bus) debug("%s, bus=%d/%s, parent=%s\n", __func__, dev_seq(bus), bus->name, bus->parent->name); - hose = bus->uclass_priv; + hose = dev_get_uclass_priv(bus); /* * Set the sequence number, if device_bind() doesn't. We want control @@ -1109,7 +1109,7 @@ static int pci_bridge_read_config(const struct udevice *bus, pci_dev_t bdf, uint offset, ulong *valuep, enum pci_size_t size) { - struct pci_controller *hose = bus->uclass_priv; + struct pci_controller *hose = dev_get_uclass_priv(bus); return pci_bus_read_config(hose->ctlr, bdf, offset, valuep, size); } @@ -1118,7 +1118,7 @@ static int pci_bridge_write_config(struct udevice *bus, pci_dev_t bdf, uint offset, ulong value, enum pci_size_t size) { - struct pci_controller *hose = bus->uclass_priv; + struct pci_controller *hose = dev_get_uclass_priv(bus); return pci_bus_write_config(hose->ctlr, bdf, offset, value, size); } |