ramips: fix MikroTik 750Gr3 ports MAC addresses
[openwrt/staging/wigyori.git] / target / linux / ramips / patches-5.4 / 0111-staging-mt7621-pci-use-only-two-phys-from-device-tre.patch
1 From c752b54bda4d772426c5eeb56978d2e41bd525b4 Mon Sep 17 00:00:00 2001
2 From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
3 Date: Fri, 20 Mar 2020 12:01:21 +0100
4 Subject: [PATCH] staging: mt7621-pci: use only two phys from device tree
5
6 In order to align work with the mt7621-pci-phy part of
7 the driver and device tree which is now using only two
8 real phys one of them dual ported properly parse the
9 device tree and don't call phy initialization for the
10 slot 1 because is being taking into account when the
11 phy for the slot 0 is instantiated.
12
13 Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
14 Link: https://lore.kernel.org/r/20200320110123.9907-4-sergio.paracuellos@gmail.com
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 ---
17 drivers/staging/mt7621-pci/pci-mt7621.c | 7 ++++++-
18 1 file changed, 6 insertions(+), 1 deletion(-)
19
20 --- a/drivers/staging/mt7621-pci/pci-mt7621.c
21 +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
22 @@ -358,7 +358,7 @@ static int mt7621_pcie_parse_port(struct
23
24 snprintf(name, sizeof(name), "pcie-phy%d", slot);
25 port->phy = devm_phy_get(dev, name);
26 - if (IS_ERR(port->phy))
27 + if (IS_ERR(port->phy) && slot != 1)
28 return PTR_ERR(port->phy);
29
30 port->gpio_rst = devm_gpiod_get_index_optional(dev, "reset", slot,
31 @@ -495,6 +495,11 @@ static void mt7621_pcie_init_ports(struc
32 list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
33 u32 slot = port->slot;
34
35 + if (slot == 1) {
36 + port->enabled = true;
37 + continue;
38 + }
39 +
40 err = mt7621_pcie_init_port(port);
41 if (err) {
42 dev_err(dev, "Initiating port %d failed\n", slot);