From f6576a1b4896b984dce0e8393efeba68cc2b96c8 Mon Sep 17 00:00:00 2001 From: Niklas Schnelle Date: Tue, 2 Mar 2021 14:55:21 +0100 Subject: s390/pci: refactor zpci function states The current zdev->state mixes the configuration states supported by CLP with an additional Online state which is used inconsistently to include enabled zPCI functions which are not yet visible to the common PCI subsytem. In preparation for a clean separation between architected configuration states and fine grained function states remove the Online function state. Where we previously checked for Online it is more accurate to check if the function is enabled to avoid an edge case where a disabled device was still treated as Online. This also simplifies checks whether a function is configured as this is now directly reflected by its function state. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens --- drivers/pci/hotplug/s390_pci_hpc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'drivers/pci/hotplug') diff --git a/drivers/pci/hotplug/s390_pci_hpc.c b/drivers/pci/hotplug/s390_pci_hpc.c index a047c421debe..c93c09ae4b04 100644 --- a/drivers/pci/hotplug/s390_pci_hpc.c +++ b/drivers/pci/hotplug/s390_pci_hpc.c @@ -20,12 +20,6 @@ #define SLOT_NAME_SIZE 10 -static int zpci_fn_configured(enum zpci_state state) -{ - return state == ZPCI_FN_STATE_CONFIGURED || - state == ZPCI_FN_STATE_ONLINE; -} - static inline int zdev_configure(struct zpci_dev *zdev) { int ret = sclp_pci_configure(zdev->fid); @@ -85,7 +79,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) struct pci_dev *pdev; int rc; - if (!zpci_fn_configured(zdev->state)) + if (zdev->state != ZPCI_FN_STATE_CONFIGURED) return -EIO; pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); -- cgit