USB: bcma: use simpler devm helper for getting vcc GPIO
authorRafał Miłecki <zajec5@gmail.com>
Wed, 23 Mar 2016 11:37:11 +0000 (12:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2016 23:11:22 +0000 (16:11 -0700)
Thanks to switching to devm_gpiod_get:
1) We don't have to pass fwnode pointer
2) We can request initial GPIO value at getting call
This was successfully tested on Netgear R6250 (BCM4708).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/bcma-hcd.c

index 963e2d0e8f92d440396ff17bc5b718f81298b682..172ef17911aad33fd5bc34a2d68e75d64ee830bf 100644 (file)
@@ -352,10 +352,8 @@ static int bcma_hcd_probe(struct bcma_device *core)
        usb_dev->core = core;
 
        if (core->dev.of_node)
-               usb_dev->gpio_desc = devm_get_gpiod_from_child(&core->dev, "vcc",
-                                                              &core->dev.of_node->fwnode);
-       if (!IS_ERR_OR_NULL(usb_dev->gpio_desc))
-               gpiod_direction_output(usb_dev->gpio_desc, 1);
+               usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
+                                                   GPIOD_OUT_HIGH);
 
        switch (core->id.id) {
        case BCMA_CORE_USB20_HOST: