Skip to content

Commit d5da41c

Browse files
Naveenaidubjorn-helgaas
authored andcommitted
PCI: mvebu: Drop error data fabrication when config read fails
If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/f30264b137b1282ffda34d336e8060bb13d60b98.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 5a50b8b commit d5da41c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/pci/controller/pci-mvebu.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -653,20 +653,16 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
653653
int ret;
654654

655655
port = mvebu_pcie_find_port(pcie, bus, devfn);
656-
if (!port) {
657-
*val = 0xffffffff;
656+
if (!port)
658657
return PCIBIOS_DEVICE_NOT_FOUND;
659-
}
660658

661659
/* Access the emulated PCI-to-PCI bridge */
662660
if (bus->number == 0)
663661
return pci_bridge_emul_conf_read(&port->bridge, where,
664662
size, val);
665663

666-
if (!mvebu_pcie_link_up(port)) {
667-
*val = 0xffffffff;
664+
if (!mvebu_pcie_link_up(port))
668665
return PCIBIOS_DEVICE_NOT_FOUND;
669-
}
670666

671667
/* Access the real PCIe interface */
672668
ret = mvebu_pcie_hw_rd_conf(port, bus, devfn,

0 commit comments

Comments
 (0)