From c4e72c4ad8b7c2db9c868bd053c25344b95900b8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 27 Jan 2020 08:49:37 -0700 Subject: 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 --- drivers/misc/p2sb_emul.c | 5 +++-- drivers/misc/swap_case.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/p2sb_emul.c b/drivers/misc/p2sb_emul.c index c3795c5..a6ee9a2 100644 --- a/drivers/misc/p2sb_emul.c +++ b/drivers/misc/p2sb_emul.c @@ -48,8 +48,9 @@ struct p2sb_emul_priv { u8 regs[16]; }; -static int sandbox_p2sb_emul_read_config(struct udevice *emul, uint offset, - ulong *valuep, enum pci_size_t size) +static int sandbox_p2sb_emul_read_config(const struct udevice *emul, + uint offset, ulong *valuep, + enum pci_size_t size) { struct p2sb_emul_platdata *plat = dev_get_platdata(emul); diff --git a/drivers/misc/swap_case.c b/drivers/misc/swap_case.c index 11189d1..97e2afa 100644 --- a/drivers/misc/swap_case.c +++ b/drivers/misc/swap_case.c @@ -51,7 +51,7 @@ struct swap_case_priv { char mem_text[MEM_TEXT_SIZE]; }; -static int sandbox_swap_case_use_ea(struct udevice *dev) +static int sandbox_swap_case_use_ea(const struct udevice *dev) { return !!ofnode_get_property(dev->node, "use-ea", NULL); } @@ -82,7 +82,7 @@ static const u32 ea_regs[] = { PCI_CAP_EA_SIZE_HI, }; -static int sandbox_swap_case_read_ea(struct udevice *emul, uint offset, +static int sandbox_swap_case_read_ea(const struct udevice *emul, uint offset, ulong *valuep, enum pci_size_t size) { u32 reg; @@ -95,8 +95,9 @@ static int sandbox_swap_case_read_ea(struct udevice *emul, uint offset, return 0; } -static int sandbox_swap_case_read_config(struct udevice *emul, uint offset, - ulong *valuep, enum pci_size_t size) +static int sandbox_swap_case_read_config(const struct udevice *emul, + uint offset, ulong *valuep, + enum pci_size_t size) { struct swap_case_platdata *plat = dev_get_platdata(emul); -- cgit v1.1