USB: bcma: Add a check for devm_gpiod_get
PATCH 1/1 USB: bcma: Add a check for devm_gpiod_get
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]>
--- drivers/usb/host/bcma-hcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/bcma-hcd.c +4 -1
@@ -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 :
Signature · 1 line
2.20.1