]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/powernv: Remove pnv_eeh_cap_start()
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 8 Oct 2015 03:58:58 +0000 (14:58 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Oct 2015 09:42:15 +0000 (20:42 +1100)
This moves the logic of pnv_eeh_cap_start() to pnv_eeh_find_cap()
as the function is only called by pnv_eeh_find_cap(). The logic
of both functions are pretty simple. No need to have separate
functions.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/eeh-powernv.c

index 2032936bdc6207f643e035d4788f19108ad0d2d9..2b5c70b54814f8d0902a2352e3d2284f9b6470a0 100644 (file)
@@ -281,29 +281,20 @@ static int pnv_eeh_post_init(void)
        return ret;
 }
 
-static int pnv_eeh_cap_start(struct pci_dn *pdn)
+static int pnv_eeh_find_cap(struct pci_dn *pdn, int cap)
 {
-       u32 status;
+       int pos = PCI_CAPABILITY_LIST;
+       int cnt = 48;   /* Maximal number of capabilities */
+       u32 status, id;
 
        if (!pdn)
                return 0;
 
+       /* Check if the device supports capabilities */
        pnv_pci_cfg_read(pdn, PCI_STATUS, 2, &status);
        if (!(status & PCI_STATUS_CAP_LIST))
                return 0;
 
-       return PCI_CAPABILITY_LIST;
-}
-
-static int pnv_eeh_find_cap(struct pci_dn *pdn, int cap)
-{
-       int pos = pnv_eeh_cap_start(pdn);
-       int cnt = 48;   /* Maximal number of capabilities */
-       u32 id;
-
-       if (!pos)
-               return 0;
-
        while (cnt--) {
                pnv_pci_cfg_read(pdn, pos, 1, &pos);
                if (pos < 0x40)