From: Niklas Schnelle Date: Thu, 8 Jan 2026 15:45:54 +0000 (+0100) Subject: s390/pci: Use PCIBIOS return values in pci_read()/pci_write() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88303fb68cc2e8b975f1505c84f215a934f6c2ad;p=thirdparty%2Flinux.git 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 Signed-off-by: Niklas Schnelle Reviewed-by: Farhan Ali Signed-off-by: Heiko Carstens --- diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 7f44b0644a20e..0d952e8fdc8af 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -406,7 +406,9 @@ static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, { struct zpci_dev *zdev = zdev_from_bus(bus, devfn); - return (zdev) ? zpci_cfg_load(zdev, where, val, size) : -ENODEV; + if (!zdev || zpci_cfg_load(zdev, where, val, size)) + return PCIBIOS_DEVICE_NOT_FOUND; + return PCIBIOS_SUCCESSFUL; } static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, @@ -414,7 +416,9 @@ static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, { struct zpci_dev *zdev = zdev_from_bus(bus, devfn); - return (zdev) ? zpci_cfg_store(zdev, where, val, size) : -ENODEV; + if (!zdev || zpci_cfg_store(zdev, where, val, size)) + return PCIBIOS_DEVICE_NOT_FOUND; + return PCIBIOS_SUCCESSFUL; } static struct pci_ops pci_root_ops = {