Skip to content

Commit

Permalink
Revert "USB: bcma: Add a check for devm_gpiod_get"
Browse files Browse the repository at this point in the history
commit d91adc5 upstream.

This reverts commit f3de5d8.

That commit broke USB on all routers that have USB always powered on and
don't require toggling any GPIO. It's a majority of devices actually.

The original code worked and seemed safe: vcc GPIO is optional and
bcma_hci_platform_power_gpio() takes care of checking the pointer before
using it.

This revert fixes:
[   10.801127] bcma_hcd: probe of bcma0:11 failed with error -2

Fixes: f3de5d8 ("USB: bcma: Add a check for devm_gpiod_get")
Cc: stable <stable@vger.kernel.org>
Cc: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20210831065419.18371-1-zajec5@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Rafał Miłecki authored and gregkh committed Sep 30, 2021
1 parent af5947c commit 63239b0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/host/bcma-hcd.c
Expand Up @@ -406,12 +406,9 @@ static int bcma_hcd_probe(struct bcma_device *core)
return -ENOMEM;
usb_dev->core = core;

if (core->dev.of_node) {
if (core->dev.of_node)
usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
GPIOD_OUT_HIGH);
if (IS_ERR(usb_dev->gpio_desc))
return PTR_ERR(usb_dev->gpio_desc);
}

switch (core->id.id) {
case BCMA_CORE_USB20_HOST:
Expand Down

0 comments on commit 63239b0

Please sign in to comment.