Skip to content

Commit 5f09342

Browse files
Naveenaidubjorn-helgaas
authored andcommitted
PCI: altera: 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/ed5020e5b008b28c33a90c9c1670cef2393d3b7e.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent d5da41c commit 5f09342

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/pci/controller/pcie-altera.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,8 @@ static int altera_pcie_cfg_read(struct pci_bus *bus, unsigned int devfn,
510510
if (altera_pcie_hide_rc_bar(bus, devfn, where))
511511
return PCIBIOS_BAD_REGISTER_NUMBER;
512512

513-
if (!altera_pcie_valid_device(pcie, bus, PCI_SLOT(devfn))) {
514-
*value = 0xffffffff;
513+
if (!altera_pcie_valid_device(pcie, bus, PCI_SLOT(devfn)))
515514
return PCIBIOS_DEVICE_NOT_FOUND;
516-
}
517515

518516
return _altera_pcie_cfg_read(pcie, bus->number, devfn, where, size,
519517
value);

0 commit comments

Comments
 (0)