Skip to content

Commit

Permalink
USB: bcma: Add a check for devm_gpiod_get
Browse files Browse the repository at this point in the history
bcma_hcd_probe misses a check for devm_gpiod_get and may miss
the error.
Add a check for it and return the error if a failure occurs.

Signed-off-by: Chuhong Yuan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
WillLester authored and gregkh committed Nov 4, 2019
1 parent 09e2a8b commit f3de5d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/usb/host/bcma-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,12 @@ 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 f3de5d8

Please sign in to comment.