OSDN Git Service

powerpc/eeh: Cleanup logic in eeh_rmv_from_parent_pe()
authorSam Bobroff <sbobroff@linux.ibm.com>
Wed, 12 Sep 2018 01:23:28 +0000 (11:23 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 13 Oct 2018 11:21:25 +0000 (22:21 +1100)
Move the call to eeh_dev_to_pe() up, so that later it's clear that
"pe" isn't NULL.

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/eeh_pe.c

index 7d6d93c..78f125d 100644 (file)
@@ -456,7 +456,8 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
        int cnt;
        struct pci_dn *pdn = eeh_dev_to_pdn(edev);
 
-       if (!edev->pe) {
+       pe = eeh_dev_to_pe(edev);
+       if (!pe) {
                pr_debug("%s: No PE found for device %04x:%02x:%02x.%01x\n",
                         __func__,  pdn->phb->global_number,
                         pdn->busno,
@@ -466,7 +467,6 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)
        }
 
        /* Remove the EEH device */
-       pe = eeh_dev_to_pe(edev);
        edev->pe = NULL;
        list_del(&edev->entry);