diff options
author | Hauke Mehrtens <hauke@openwrt.org> | 2015-12-02 15:24:53 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@openwrt.org> | 2015-12-02 15:24:53 +0000 |
commit | 12ef4b090dc358eb905259dc12dda25b042b6687 (patch) | |
tree | 1640fa9a739148aedcee8ec9c0497752cba2a333 /target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch | |
parent | 8fdb4d2eaa72125879fb3e05ede6913a3733f86a (diff) | |
download | master-187ad058-12ef4b090dc358eb905259dc12dda25b042b6687.tar.gz master-187ad058-12ef4b090dc358eb905259dc12dda25b042b6687.tar.bz2 master-187ad058-12ef4b090dc358eb905259dc12dda25b042b6687.zip |
bcm53xx: update PCIe driver
This updates the iProc PCIe driver to the version currently submitted
for kernel 4.5.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47688 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch')
-rw-r--r-- | target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch b/target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch new file mode 100644 index 0000000000..fc83337de7 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.1/035-PCI-iproc-Delete-unnecessary-checks-before-phy-calls.patch @@ -0,0 +1,79 @@ +From 93972d18bbaba6f34e21742400b6e7461edc4837 Mon Sep 17 00:00:00 2001 +From: Markus Elfring <elfring@users.sourceforge.net> +Date: Sun, 28 Jun 2015 16:42:04 +0200 +Subject: [PATCH] PCI: iproc: Delete unnecessary checks before phy calls + +The functions phy_exit() and phy_power_off() test whether their argument is +NULL and then return immediately. Thus the test around the calls is not +needed. + +This issue was detected by using the Coccinelle software. + +[bhelgaas: also phy_init() and phy_power_on(), as Ray Jui suggested] +[bhelgaas: also remove tests in iproc_pcie_remove()] +Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> +Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> +Reviewed-by: Ray Jui <rjui@broadcom.com> +--- + drivers/pci/host/pcie-iproc.c | 34 +++++++++++++--------------------- + 1 file changed, 13 insertions(+), 21 deletions(-) + +--- a/drivers/pci/host/pcie-iproc.c ++++ b/drivers/pci/host/pcie-iproc.c +@@ -191,19 +191,16 @@ int iproc_pcie_setup(struct iproc_pcie * + if (!pcie || !pcie->dev || !pcie->base) + return -EINVAL; + +- if (pcie->phy) { +- ret = phy_init(pcie->phy); +- if (ret) { +- dev_err(pcie->dev, "unable to initialize PCIe PHY\n"); +- return ret; +- } +- +- ret = phy_power_on(pcie->phy); +- if (ret) { +- dev_err(pcie->dev, "unable to power on PCIe PHY\n"); +- goto err_exit_phy; +- } ++ ret = phy_init(pcie->phy); ++ if (ret) { ++ dev_err(pcie->dev, "unable to initialize PCIe PHY\n"); ++ return ret; ++ } + ++ ret = phy_power_on(pcie->phy); ++ if (ret) { ++ dev_err(pcie->dev, "unable to power on PCIe PHY\n"); ++ goto err_exit_phy; + } + + iproc_pcie_reset(pcie); +@@ -239,12 +236,9 @@ err_rm_root_bus: + pci_remove_root_bus(bus); + + err_power_off_phy: +- if (pcie->phy) +- phy_power_off(pcie->phy); ++ phy_power_off(pcie->phy); + err_exit_phy: +- if (pcie->phy) +- phy_exit(pcie->phy); +- ++ phy_exit(pcie->phy); + return ret; + } + EXPORT_SYMBOL(iproc_pcie_setup); +@@ -254,10 +248,8 @@ int iproc_pcie_remove(struct iproc_pcie + pci_stop_root_bus(pcie->root_bus); + pci_remove_root_bus(pcie->root_bus); + +- if (pcie->phy) { +- phy_power_off(pcie->phy); +- phy_exit(pcie->phy); +- } ++ phy_power_off(pcie->phy); ++ phy_exit(pcie->phy); + + return 0; + } |