ramips: 5.10: copy patches from 5.4
[openwrt/staging/rmilecki.git] / target / linux / ramips / patches-5.10 / 0109-staging-mt7621-pci-don-t-return-if-get-gpio-fails.patch
1 From 23a788c23ed10e0d79092fcb693dcf0e357e1f7e Mon Sep 17 00:00:00 2001
2 From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
3 Date: Thu, 19 Mar 2020 17:14:16 +0100
4 Subject: [PATCH] staging: mt7621-pci: don't return if get gpio fails
5
6 In some platforms gpio's are not used for reset but
7 for other purposes. Because of that when we try to
8 get them are valid gpio's but are already assigned
9 to do other function. To avoid those kind of problems
10 in those platforms just notice the fail in the kernel
11 but continue doing normal boot.
12
13 Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
14 Link: https://lore.kernel.org/r/20200319161416.19033-1-sergio.paracuellos@gmail.com
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16 ---
17 drivers/staging/mt7621-pci/pci-mt7621.c | 6 ++----
18 1 file changed, 2 insertions(+), 4 deletions(-)
19
20 --- a/drivers/staging/mt7621-pci/pci-mt7621.c
21 +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
22 @@ -363,10 +363,8 @@ static int mt7621_pcie_parse_port(struct
23
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_err(dev, "Failed to get GPIO for PCIe%d\n", slot);
28 - return PTR_ERR(port->gpio_rst);
29 - }
30 + if (IS_ERR(port->gpio_rst))
31 + dev_notice(dev, "Failed to get GPIO for PCIe%d\n", slot);
32
33 port->slot = slot;
34 port->pcie = pcie;