Commit Graph

633246 Commits

Author SHA1 Message Date
Bjorn Helgaas a581fa9936 PCI: tegra: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:45:25 -05:00
Bjorn Helgaas 8dd99bca7b PCI: tegra: Fix argument order in tegra_pcie_phy_disable()
The tegra_pcie_phy_disable() path called pads_writel() with arguments in
the wrong order.  Swap them to be the "value, offset" order expected by
pads_writel().

Fixes: 6fe7c187e0 ("PCI: tegra: Support per-lane PHYs")
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Thierry Reding <treding@nvidia.com>
CC: stable@vger.kernel.org	# v4.7+
2016-10-11 23:45:24 -05:00
Bjorn Helgaas 9d274755c6 PCI: rockchip: Remove unused platform data
The rockchip driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
2016-10-11 23:38:10 -05:00
Bjorn Helgaas de9e6bc84b PCI: rcar-gen2: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
2016-10-11 23:34:57 -05:00
Bjorn Helgaas 3ff8e4ac3a PCI: rcar: Remove DRV_NAME macro
The DRV_NAME macro is only used once, so there's no real advantage to
having the macro at all.  Remove it and use the "rcar-pcie" name directly
in the struct platform_driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
2016-10-11 23:34:49 -05:00
Bjorn Helgaas d0206f2121 PCI: rcar: Remove unused rcar_pcie_get_resources() platform_device arg
rcar_pcie_get_resources() doesn't use the platform_device pointer passed to
it, so remove it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
2016-10-11 23:34:34 -05:00
Bjorn Helgaas d9c64c500a PCI: rcar: Remove unused platform data
The rcar driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
2016-10-11 23:34:28 -05:00
Bjorn Helgaas ee05369412 PCI: qcom: Reorder struct qcom_pcie
Reorder struct qcom_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:27:46 -05:00
Bjorn Helgaas e6a087eeaf PCI: qcom: Remove redundant struct qcom_pcie.dev
Remove the struct qcom_pcie.dev member, which is a duplicate of the generic
pp.dev member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:26:02 -05:00
Bjorn Helgaas 0edd578e7a PCI: qcom: Remove redundant struct qcom_pcie.dbi
Remove the struct qcom_pcie.dbi member, which is a duplicate of the generic
pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:23:15 -05:00
Bjorn Helgaas 661a0e4ce0 PCI: qcom: Remove unused platform data
The qcom driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:22:45 -05:00
Bjorn Helgaas 96f61707f2 PCI: mvebu: Use existing of_node pointer
Use the existing "np" pointer instead of looking up dev->of_node again.  No
functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:19:05 -05:00
Bjorn Helgaas 160b4e4189 PCI: mvebu: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:16:46 -05:00
Bjorn Helgaas 6caaa28d92 PCI: layerscape: Reorder struct ls_pcie
Reorder struct ls_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:15:58 -05:00
Bjorn Helgaas 4726a8231e PCI: layerscape: Remove unused ls_add_pcie_port() platform_device arg
ls_add_pcie_port() doesn't use the platform_device pointer passed to it, so
remove it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:14:46 -05:00
Bjorn Helgaas fefe6733e5 PCI: layerscape: Move struct pcie_port setup to probe function
Do the basic pcie_port setup in the probe function for consistency with
other drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:14:29 -05:00
Bjorn Helgaas 7b0b11133c PCI: layerscape: Pass device-specific struct to internal functions
Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:14:25 -05:00
Bjorn Helgaas d41d295959 PCI: layerscape: Remove redundant struct ls_pcie.dbi
Remove the struct ls_pcie.dbi member, which is a duplicate of the generic
pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:14:22 -05:00
Bjorn Helgaas 9f6a148f82 PCI: layerscape: Remove unused platform data
The layerscape driver never uses the platform drvdata pointer, so don't
bother setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 23:13:24 -05:00
Bjorn Helgaas c11125ebe7 PCI: layerscape: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:59:55 -05:00
Bjorn Helgaas 4841f3ad0c PCI: keystone: Reorder struct keystone_pcie
Reorder struct keystone_pcie to put generic fields first.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:58:43 -05:00
Bjorn Helgaas 5c725353e1 PCI: keystone: Add app register accessors
Add device-specific register accessors for consistency across host drivers.
No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:58:34 -05:00
Bjorn Helgaas e481e0d00d PCI: keystone: Pass keystone_pcie, not va_app_base, to DBI functions
Instead of passing ks_pcie->va_app_base to DBI mode functions,
pass the struct keystone_pcie.  This will allow them to use register
accessors.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:56:55 -05:00
Bjorn Helgaas 5649e4ced9 PCI: keystone: Pass keystone_pcie, not address, to IRQ functions
Instead of passing the application register base to IRQ functions,
pass the struct keystone_pcie.  This will allow them to use register
accessors.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:56:46 -05:00
Bjorn Helgaas f3eca6c4f4 PCI: keystone: Use generic DesignWare accessors
The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the keystone
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:54:54 -05:00
Bjorn Helgaas 21fa0c51f0 PCI: keystone: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:53:22 -05:00
Bjorn Helgaas e3a1698b1e PCI: iproc: Hard-code PCIe capability offset instead of searching
We know where the PCIe capability lives in the host bridge's config space;
in fact, we already hard-coded the offset of the Link Control 2 register.

The hard-coded Link Control 2 offset was 0xdc.  Link Control 2 is at offset
0x30 into the PCIe capability, so the capability itself must be at
0xdc - 0x30 = 0xac.

Hard-code the PCIe capability offset, which means we don't have to search
for it and we can use the standard definitions for registers within the
capability.

No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:44:22 -05:00
Bjorn Helgaas 6d76833c52 PCI: iproc: Remove redundant null pointer checking
The callers never pass a null "pcie" pointer (they check for kzalloc
failure), so we don't need to check here.  The bus driver should never call
the probe function with a null ->dev pointer, so we don't need to check
that either.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:41:07 -05:00
Bjorn Helgaas f66e5b2907 PCI: iproc: Validate CSR base in BCMA setup code
Validate iproc_pcie->base for BCMA devices just like we already do for
platform devices in iproc_pcie_pltfm_probe().  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:38:51 -05:00
Bjorn Helgaas 556c7bb7df PCI: iproc: Set drvdata at end of probe function
Set the drvdata pointer at the end of probe function for consistency with
other drivers.  We don't need the drvdata until after the probe completes,
and we don't need it at all if the probe fails.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:36:38 -05:00
Bjorn Helgaas 786aeccb4a PCI: iproc: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:28:01 -05:00
Bjorn Helgaas 9ab021b6cf PCI: imx6: Remove unused return values
Remove unused return values.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:26:28 -05:00
Bjorn Helgaas 916bf1cc65 PCI: imx6: Reorder struct imx6_pcie
Reorder struct imx6_pcie to put generic fields first.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:26:28 -05:00
Bjorn Helgaas 2a6a85d536 PCI: imx6: Use generic DesignWare accessors
The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the imx6
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:26:28 -05:00
Bjorn Helgaas e7d7705ace PCI: imx6: Pass device-specific struct to internal functions
Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:26:28 -05:00
Bjorn Helgaas 8bad7f2fc3 PCI: imx6: Pass struct imx6_pcie to PHY accessors
Pass the struct imx6_pcie pointer, not dbi_base address, to PHY accessors.
This enables future simplifications.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:09:32 -05:00
Bjorn Helgaas 51c84709b8 PCI: imx6: Removed unused struct imx6_pcie.mem_base
Removed the unused struct imx6_pcie.mem_base member.  No functional change
intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:03:40 -05:00
Bjorn Helgaas c5af40747c PCI: imx6: Remove redundant of_node pointer
"np" and "node" are redundant copies of the of_node pointer.  Remove "np"
and use "node" instead.  Replace the "fsl,max-link-speed" use with "node"
as well.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 22:00:50 -05:00
Bjorn Helgaas 13957652f7 PCI: imx6: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:54:51 -05:00
Bjorn Helgaas 4368f096c4 PCI: hisi: Use generic DesignWare accessors
The dw_pcie_readl_rc() and dw_pcie_writel_rc() interfaces already add in
pp->dbi_base, so use those instead of doing it ourselves in the hisi
driver.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:45:19 -05:00
Bjorn Helgaas 761c43c735 PCI: hisi: Remove redundant struct hisi_pcie.reg_base
Remove the struct hisi_pcie.reg_base member, which is a duplicate of the
generic pp.dbi_base member.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:43:12 -05:00
Bjorn Helgaas bf4ed37cbb PCI: hisi: Name private struct pointer "hisi_pcie" consistently
Most struct hisi_pcie pointers are already called "hisi_pcie".  Change
the rest of them to match.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:40:32 -05:00
Bjorn Helgaas d5d4f6e423 PCI: hisi: Remove unused platform data
The hisi driver never uses the platform drvdata pointer, so don't bother
setting it.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:38:45 -05:00
Bjorn Helgaas 88790f99c7 PCI: hisi: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:32:09 -05:00
Bjorn Helgaas 6b1f185a5f PCI: exynos: Reorder struct exynos_pcie
Reorder struct exynos_pcie to put generic fields first.  No functional
change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:30:52 -05:00
Bjorn Helgaas cc08e82b85 PCI: exynos: Pass device-specific struct to internal functions
Only interfaces used from outside the driver, e.g., those called by the
DesignWare core, need to accept pointers to the generic struct pcie_port.
Internal interfaces can accept pointers to the device-specific struct,
which makes them more straightforward.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:26:39 -05:00
Bjorn Helgaas 10284bfa34 PCI: exynos: Name private struct pointer "exynos_pcie" consistently
Most struct exynos_pcie pointers are already called "exynos_pcie".  Change
the rest of them to match.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:24:29 -05:00
Bjorn Helgaas 53e5bff16f PCI: exynos: Uninline register accessors
The register accessors are not performance critical and are small enough
that the compiler can inline them itself if it makes sense.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:24:12 -05:00
Bjorn Helgaas fae68d690d PCI: exynos: Add local struct device pointers
Use a local "struct device *dev" for brevity and consistency with other
drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:18:59 -05:00
Bjorn Helgaas 150645b943 PCI: dra7xx: Move struct pcie_port setup to probe function
Do the basic pcie_port setup in the probe function for consistency with
other drivers.  No functional change intended.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2016-10-11 21:14:30 -05:00