From: Dmitry Torokhov Date: Tue, 27 Sep 2022 22:05:04 +0000 (-0700) Subject: usb: host: ehci-exynos: switch to using gpiod API X-Git-Tag: v6.6.17~6449^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0d381caf99317977942e1228cdc2e14392e1d72;p=platform%2Fkernel%2Flinux-rpi.git usb: host: ehci-exynos: switch to using gpiod API This patch switches the driver from using legacy gpio API to the newer gpiod API. Signed-off-by: Dmitry Torokhov Acked-by: Alan Stern Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220927220504.3744878-2-dmitry.torokhov@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index c8e152c..a333231 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -131,20 +131,13 @@ static void exynos_ehci_phy_disable(struct device *dev) static void exynos_setup_vbus_gpio(struct device *dev) { + struct gpio_desc *gpio; int err; - int gpio; - if (!dev->of_node) - return; - - gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0); - if (!gpio_is_valid(gpio)) - return; - - err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH, - "ehci_vbus_gpio"); + gpio = devm_gpiod_get_optional(dev, "samsung,vbus", GPIOD_OUT_HIGH); + err = PTR_ERR_OR_ZERO(gpio); if (err) - dev_err(dev, "can't request ehci vbus gpio %d", gpio); + dev_err(dev, "can't request ehci vbus gpio: %d\n", err); } static int exynos_ehci_probe(struct platform_device *pdev)