]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pci: fix clp_get_state() handling of -ENODEV
authorNiklas Schnelle <schnelle@linux.ibm.com>
Fri, 3 Sep 2021 16:27:01 +0000 (18:27 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 7 Sep 2021 11:38:42 +0000 (13:38 +0200)
commite70b02778d30868543c9c9955de3079dbb75cb8e
tree521f3c056897d525d259087b88c2576353e79edf
parentdeeb291d21d745e1e83c49f0fbb110e997ef5b3b
s390/pci: fix clp_get_state() handling of -ENODEV

With commit c81f4ee1ff4a ("s390/pci: simplify CLP List PCI handling")
clp_get_state() was changed to make use of the new clp_find_pci() helper
function to query a specific function. This however returns -ENODEV when
the device is not found at all and this error was passed to the caller.
It was missed however that the callers actually expect a success return
from clp_get_state() if the device is gone.

Fix this by handling the -ENODEV return of clp_find_pci() explicitly in
clp_get_state() returning success and setting the state parameter to
ZPCI_FN_STATE_RESERVED matching the design concept that a PCI function
that disappeared must have been resverved elsewhere. For all other error
returns continue to just pass them on to the caller.

Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Fixes: c81f4ee1ff4a ("s390/pci: simplify CLP List PCI handling")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/pci/pci_clp.c