diff options
author | Simon Glass <sjg@chromium.org> | 2020-01-27 08:49:37 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-02-05 19:33:45 -0700 |
commit | c4e72c4ad8b7c2db9c868bd053c25344b95900b8 (patch) | |
tree | fd7f628f007e60b6a9f69d94b14421ffe226ae27 /drivers/pci/pci-uclass.c | |
parent | fc347fbdd44a01b1aba6283dec56c1374baca383 (diff) |
dm: pci: Update the PCI read_config() method to const dev *
At present this method uses a non-const udevice pointer, but the call
should not modify the device. Use a const pointer.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/pci/pci-uclass.c')
-rw-r--r-- | drivers/pci/pci-uclass.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index 5be2dfd0bf..78d4129572 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -124,7 +124,7 @@ static void pci_dev_find_ofnode(struct udevice *bus, phys_addr_t bdf, } }; -int pci_bus_find_devfn(struct udevice *bus, pci_dev_t find_devfn, +int pci_bus_find_devfn(const struct udevice *bus, pci_dev_t find_devfn, struct udevice **devp) { struct udevice *dev; @@ -551,8 +551,9 @@ int pci_auto_config_devices(struct udevice *bus) } int pci_generic_mmap_write_config( - struct udevice *bus, - int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp), + const struct udevice *bus, + int (*addr_f)(const struct udevice *bus, pci_dev_t bdf, uint offset, + void **addrp), pci_dev_t bdf, uint offset, ulong value, @@ -579,8 +580,9 @@ int pci_generic_mmap_write_config( } int pci_generic_mmap_read_config( - struct udevice *bus, - int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp), + const struct udevice *bus, + int (*addr_f)(const struct udevice *bus, pci_dev_t bdf, uint offset, + void **addrp), pci_dev_t bdf, uint offset, ulong *valuep, @@ -1054,7 +1056,7 @@ static int pci_uclass_child_post_bind(struct udevice *dev) return 0; } -static int pci_bridge_read_config(struct udevice *bus, pci_dev_t bdf, +static int pci_bridge_read_config(const struct udevice *bus, pci_dev_t bdf, uint offset, ulong *valuep, enum pci_size_t size) { |