ramips: fix MikroTik 750Gr3 ports MAC addresses
[openwrt/staging/wigyori.git] / target / linux / ramips / patches-5.4 / 0115-staging-mt7621-pci-delete-release-gpios-related-code.patch
1 From 9d789a7728c37e8730b6a9cca60cf155f18537ea Mon Sep 17 00:00:00 2001
2 From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
3 Date: Sat, 21 Mar 2020 08:26:50 +0100
4 Subject: [PATCH] staging: mt7621-pci: delete release gpios related code
5
6 Making gpio8 and gpio9 vendor specific and putting them
7 into the specific dts file makes not needed to release
8 gpios anymore because we are not occupying those pins
9 in the first place if it is not necessary. When the
10 device tree is parsed we can also check and return for
11 the error because we rely in the fact that the related
12 device for the board is correct.
13
14 Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
15 Link: https://lore.kernel.org/r/20200321072650.7784-3-sergio.paracuellos@gmail.com
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 ---
18 drivers/staging/mt7621-pci/pci-mt7621.c | 27 +++++++--------------------
19 1 file changed, 7 insertions(+), 20 deletions(-)
20
21 --- a/drivers/staging/mt7621-pci/pci-mt7621.c
22 +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
23 @@ -364,8 +364,8 @@ static int mt7621_pcie_parse_port(struct
24 port->gpio_rst = devm_gpiod_get_index_optional(dev, "reset", slot,
25 GPIOD_OUT_LOW);
26 if (IS_ERR(port->gpio_rst)) {
27 - dev_notice(dev, "Failed to get GPIO for PCIe%d\n", slot);
28 - port->gpio_rst = NULL;
29 + dev_err(dev, "Failed to get GPIO for PCIe%d\n", slot);
30 + return PTR_ERR(port->gpio_rst);
31 }
32
33 port->slot = slot;
34 @@ -474,15 +474,6 @@ static void mt7621_pcie_reset_ep_deasser
35 mdelay(PERST_DELAY_MS);
36 }
37
38 -static void mt7621_pcie_release_gpios(struct mt7621_pcie *pcie)
39 -{
40 - struct mt7621_pcie_port *port;
41 -
42 - list_for_each_entry(port, &pcie->ports, list)
43 - if (port->gpio_rst)
44 - gpiod_put(port->gpio_rst);
45 -}
46 -
47 static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
48 {
49 struct device *dev = pcie->dev;
50 @@ -684,7 +675,7 @@ static int mt7621_pci_probe(struct platf
51 err = mt7621_pci_parse_request_of_pci_ranges(pcie);
52 if (err) {
53 dev_err(dev, "Error requesting pci resources from ranges");
54 - goto out_release_gpios;
55 + return err;
56 }
57
58 /* set resources limits */
59 @@ -698,8 +689,7 @@ static int mt7621_pci_probe(struct platf
60 err = mt7621_pcie_init_virtual_bridges(pcie);
61 if (err) {
62 dev_err(dev, "Nothing is connected in virtual bridges. Exiting...");
63 - err = 0;
64 - goto out_release_gpios;
65 + return 0;
66 }
67
68 mt7621_pcie_enable_ports(pcie);
69 @@ -709,19 +699,16 @@ static int mt7621_pci_probe(struct platf
70 err = mt7621_pcie_request_resources(pcie, &res);
71 if (err) {
72 dev_err(dev, "Error requesting resources\n");
73 - goto out_release_gpios;
74 + return err;
75 }
76
77 err = mt7621_pcie_register_host(bridge, &res);
78 if (err) {
79 dev_err(dev, "Error registering host\n");
80 - goto out_release_gpios;
81 + return err;
82 }
83
84 -out_release_gpios:
85 - mt7621_pcie_release_gpios(pcie);
86 -
87 - return err;
88 + return 0;
89 }
90
91 static const struct of_device_id mt7621_pci_ids[] = {