Thread (14 messages) 14 messages, 4 authors, 2015-01-21

Re: [PATCH 4/5] PCI: qcom: Add Qualcomm PCIe controller driver

From: Arnd Bergmann <arnd@arndb.de>
Date: 2014-12-12 17:30:30
Also in: linux-arm-kernel, linux-arm-msm, linux-pci, lkml

On Friday 12 December 2014 19:14:00 Stanimir Varbanov wrote:
The PCIe driver reuse the Designware common code for host
and MSI initialization, and also program the Qualcomm
application specific registers.

Signed-off-by: Stanimir Varbanov <redacted>
Looks nice!
+static int
+qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, u32 *val)
+{
+	if (where == PCI_CLASS_REVISION && size == 4) {
+		*val = readl(pp->dbi_base + PCI_CLASS_REVISION);
+		*val &= ~(0xffff << 16);
+		*val |= PCI_CLASS_BRIDGE_PCI << 16;
+		return PCIBIOS_SUCCESSFUL;
+	}
+
+	return dw_pcie_cfg_read(pp->dbi_base + (where & ~0x3), where,
+				size, val);
+}
Could you add a comment here to explain what this is for?
+static int __init qcom_pcie_probe(struct platform_device *pdev)
+{
I think it's a bug to mark this function as __init. It breaks
deferred probing and detaching/reattaching the device trough sysfs.

After you fix that, you can remove the __refdata below.
+static struct platform_driver __refdata qcom_pcie_driver = {
+	.probe = qcom_pcie_probe,
+	.remove = qcom_pcie_remove,
+	.driver = {
+		.name = "qcom-pcie",
+		.of_match_table = qcom_pcie_match,
+	},
+};
	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help