Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: qcom: Use default config space read function

Move the device class fudge to a proper fixup function, and remove
qcom_pcie_rd_own_conf() which has become useless.

dw_pcie_setup_rc() already did the right thing, but it's broken
on older qcom chips, such as 8064.

Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>

authored by

Marc Gonzalez and committed by
Bjorn Helgaas
322f0343 9e98c678

+6 -17
+6 -17
drivers/pci/controller/dwc/pcie-qcom.c
··· 1129 1129 return ret; 1130 1130 } 1131 1131 1132 - static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, 1133 - u32 *val) 1134 - { 1135 - struct dw_pcie *pci = to_dw_pcie_from_pp(pp); 1136 - 1137 - /* the device class is not reported correctly from the register */ 1138 - if (where == PCI_CLASS_REVISION && size == 4) { 1139 - *val = readl(pci->dbi_base + PCI_CLASS_REVISION); 1140 - *val &= 0xff; /* keep revision id */ 1141 - *val |= PCI_CLASS_BRIDGE_PCI << 16; 1142 - return PCIBIOS_SUCCESSFUL; 1143 - } 1144 - 1145 - return dw_pcie_read(pci->dbi_base + where, size, val); 1146 - } 1147 - 1148 1132 static const struct dw_pcie_host_ops qcom_pcie_dw_ops = { 1149 1133 .host_init = qcom_pcie_host_init, 1150 - .rd_own_conf = qcom_pcie_rd_own_conf, 1151 1134 }; 1152 1135 1153 1136 /* Qcom IP rev.: 2.1.0 Synopsys IP rev.: 4.01a */ ··· 1291 1308 { .compatible = "qcom,pcie-ipq4019", .data = &ops_2_4_0 }, 1292 1309 { } 1293 1310 }; 1311 + 1312 + static void qcom_fixup_class(struct pci_dev *dev) 1313 + { 1314 + dev->class = PCI_CLASS_BRIDGE_PCI << 8; 1315 + } 1316 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, PCI_ANY_ID, qcom_fixup_class); 1294 1317 1295 1318 static struct platform_driver qcom_pcie_driver = { 1296 1319 .probe = qcom_pcie_probe,