pci: pci_mvebu: Fix write_config() with PCI_SIZE_8 or PCI_SIZE_16
authorPali Rohár <pali@kernel.org>
Fri, 22 Oct 2021 14:22:08 +0000 (16:22 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:26 +0000 (06:45 +0100)
commitdaa9bfdb9cff9cc7ff0ad93383bbaf2bd618ab5e
treee8ca69b07b0c55d9791dfbeb1b22b60b189e5f0e
parenta79115dde373f7cdb181040dd6489fd0b21bfbd2
pci: pci_mvebu: Fix write_config() with PCI_SIZE_8 or PCI_SIZE_16

Current implementation of write_config() is broken for PCI_SIZE_8 or
PCI_SIZE_16 as it always uses writel(), which means that write operation
is always 32-bit, so upper 24 bits for PCI_SIZE_8 and upper 16 bits for
PCI_SIZE_16 are cleared.

Fix this by using writeb() and writew(), respectively.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/pci/pci_mvebu.c