bcm53xx: fix USB in kernel 5.10
[openwrt/staging/stintel.git] / target / linux / bcm53xx / patches-5.10 / 181-Revert-USB-bcma-Add-a-check-for-devm_gpiod_get.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
2 Date: Tue, 31 Aug 2021 08:40:49 +0200
3 Subject: [PATCH fix] Revert "USB: bcma: Add a check for devm_gpiod_get"
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset=UTF-8
6 Content-Transfer-Encoding: 8bit
7
8 This reverts commit f3de5d857bb2362b00e2a8d4bc886cd49dcb66db.
9
10 That commit broke USB on all routers that have USB always powered on and
11 don't require toggling any GPIO. It's a majority of devices actually.
12
13 The original code worked and seemed safe: vcc GPIO is optional and
14 bcma_hci_platform_power_gpio() takes care of checking the pointer before
15 using it.
16
17 This revert fixes:
18 [ 10.801127] bcma_hcd: probe of bcma0:11 failed with error -2
19
20 Cc: Chuhong Yuan <hslester96@gmail.com>
21 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
22 ---
23 drivers/usb/host/bcma-hcd.c | 5 +----
24 1 file changed, 1 insertion(+), 4 deletions(-)
25
26 --- a/drivers/usb/host/bcma-hcd.c
27 +++ b/drivers/usb/host/bcma-hcd.c
28 @@ -406,12 +406,9 @@ static int bcma_hcd_probe(struct bcma_de
29 return -ENOMEM;
30 usb_dev->core = core;
31
32 - if (core->dev.of_node) {
33 + if (core->dev.of_node)
34 usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
35 GPIOD_OUT_HIGH);
36 - if (IS_ERR(usb_dev->gpio_desc))
37 - return PTR_ERR(usb_dev->gpio_desc);
38 - }
39
40 switch (core->id.id) {
41 case BCMA_CORE_USB20_HOST: