Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

s390/pci: Use PCIBIOS return values in pci_read()/pci_write()

While pci_read() and pci_write() have returned errno values since their
inception with commit cd24834130ac ("s390/pci: base support") other
config accessors in particular pci_generic_config_read() as well as
pci_generic_config_write() return specific error values which are then
converted to errno by pcibios_err_to_errno(). Since latter does handle
the case where the error value already looks like an errno the previous
behavior is unlikely to cause actual issues.

Still, for consistency and in case any caller explicitly checks error
values align pci_read() and pci_write() with the generic accessors.

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Niklas Schnelle and committed by
Heiko Carstens
88303fb6 84d875e6

+6 -2
+6 -2
arch/s390/pci/pci.c
··· 406 406 { 407 407 struct zpci_dev *zdev = zdev_from_bus(bus, devfn); 408 408 409 - return (zdev) ? zpci_cfg_load(zdev, where, val, size) : -ENODEV; 409 + if (!zdev || zpci_cfg_load(zdev, where, val, size)) 410 + return PCIBIOS_DEVICE_NOT_FOUND; 411 + return PCIBIOS_SUCCESSFUL; 410 412 } 411 413 412 414 static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, ··· 416 414 { 417 415 struct zpci_dev *zdev = zdev_from_bus(bus, devfn); 418 416 419 - return (zdev) ? zpci_cfg_store(zdev, where, val, size) : -ENODEV; 417 + if (!zdev || zpci_cfg_store(zdev, where, val, size)) 418 + return PCIBIOS_DEVICE_NOT_FOUND; 419 + return PCIBIOS_SUCCESSFUL; 420 420 } 421 421 422 422 static struct pci_ops pci_root_ops = {