powerpc/eeh: Remove class code field from edev
authorOliver O'Halloran <oohall@gmail.com>
Sat, 25 Jul 2020 08:12:28 +0000 (18:12 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 26 Jul 2020 13:34:21 +0000 (23:34 +1000)
The edev->class_code field is never referenced anywhere except for the
platform specific probe functions. The same information is available in
the pci_dev for PowerNV and in the pci_dn on pseries so we can remove
the field.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200725081231.39076-11-oohall@gmail.com
arch/powerpc/include/asm/eeh.h
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/pseries/eeh_pseries.c

index f8ef27f..79de862 100644 (file)
@@ -133,7 +133,6 @@ static inline bool eeh_pe_passed(struct eeh_pe *pe)
 
 struct eeh_dev {
        int mode;                       /* EEH mode                     */
-       int class_code;                 /* Class code of the device     */
        int bdfn;                       /* bdfn of device (for cfg ops) */
        struct pci_controller *controller;
        int pe_config_addr;             /* PE config address            */
index c9f2f45..7cbb03a 100644 (file)
@@ -372,19 +372,18 @@ static struct eeh_dev *pnv_eeh_probe(struct pci_dev *pdev)
        }
 
        /* Skip for PCI-ISA bridge */
-       if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA)
+       if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
                return NULL;
 
        eeh_edev_dbg(edev, "Probing device\n");
 
        /* Initialize eeh device */
-       edev->class_code = pdn->class_code;
        edev->mode      &= 0xFFFFFF00;
        edev->pcix_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_PCIX);
        edev->pcie_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_EXP);
        edev->af_cap   = pnv_eeh_find_cap(pdn, PCI_CAP_ID_AF);
        edev->aer_cap  = pnv_eeh_find_ecap(pdn, PCI_EXT_CAP_ID_ERR);
-       if ((edev->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) {
+       if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
                edev->mode |= EEH_DEV_BRIDGE;
                if (edev->pcie_cap) {
                        pnv_pci_cfg_read(pdn, edev->pcie_cap + PCI_EXP_FLAGS,
index 53e5381..902b929 100644 (file)
@@ -440,12 +440,11 @@ void pseries_eeh_init_edev(struct pci_dn *pdn)
         * correctly reflects that current device is root port
         * or PCIe switch downstream port.
         */
-       edev->class_code = pdn->class_code;
        edev->pcix_cap = pseries_eeh_find_cap(pdn, PCI_CAP_ID_PCIX);
        edev->pcie_cap = pseries_eeh_find_cap(pdn, PCI_CAP_ID_EXP);
        edev->aer_cap = pseries_eeh_find_ecap(pdn, PCI_EXT_CAP_ID_ERR);
        edev->mode &= 0xFFFFFF00;
-       if ((edev->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) {
+       if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) {
                edev->mode |= EEH_DEV_BRIDGE;
                if (edev->pcie_cap) {
                        rtas_read_config(pdn, edev->pcie_cap + PCI_EXP_FLAGS,