summaryrefslogtreecommitdiffstats
path: root/drivers/staging/mt7621-pci
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2020-03-20 12:01:21 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-20 15:10:50 +0100
commitbf516f413f4e8741ed83056429c24dd3ad648f09 (patch)
treec886980aa62b6647465ab70305a8ab599f8cf738 /drivers/staging/mt7621-pci
parentf178754e92c48908b155863a040e776b4b79a2b3 (diff)
downloadlinux-bf516f413f4e8741ed83056429c24dd3ad648f09.tar.bz2
staging: mt7621-pci: use only two phys from device tree
In order to align work with the mt7621-pci-phy part of the driver and device tree which is now using only two real phys one of them dual ported properly parse the device tree and don't call phy initialization for the slot 1 because is being taking into account when the phy for the slot 0 is instantiated. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20200320110123.9907-4-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-pci')
-rw-r--r--drivers/staging/mt7621-pci/pci-mt7621.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index d6fc8a08c9bd..a521653d8dba 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -358,7 +358,7 @@ static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie,
snprintf(name, sizeof(name), "pcie-phy%d", slot);
port->phy = devm_phy_get(dev, name);
- if (IS_ERR(port->phy))
+ if (IS_ERR(port->phy) && slot != 1)
return PTR_ERR(port->phy);
port->gpio_rst = devm_gpiod_get_index_optional(dev, "reset", slot,
@@ -495,6 +495,11 @@ static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
u32 slot = port->slot;
+ if (slot == 1) {
+ port->enabled = true;
+ continue;
+ }
+
err = mt7621_pcie_init_port(port);
if (err) {
dev_err(dev, "Initiating port %d failed\n", slot);