linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API
Date: Wed, 28 Sep 2022 11:15:31 -0400	[thread overview]
Message-ID: <YzRlE3u7cIBL8Y1k@rowland.harvard.edu> (raw)
In-Reply-To: <20220927220504.3744878-2-dmitry.torokhov@gmail.com>

On Tue, Sep 27, 2022 at 03:05:04PM -0700, Dmitry Torokhov wrote:
> This patch switches the driver from using legacy gpio API to the newer
> gpiod API.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ehci-exynos.c | 17 +++++------------
>  1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
> index c8e152c2e0ce..a333231616f4 100644
> --- a/drivers/usb/host/ehci-exynos.c
> +++ b/drivers/usb/host/ehci-exynos.c
> @@ -13,7 +13,7 @@
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> -#include <linux/of_gpio.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/phy/phy.h>
>  #include <linux/platform_device.h>
>  #include <linux/usb.h>
> @@ -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)
> -- 
> 2.38.0.rc1.362.ged0d419d3c-goog
> 

  parent reply	other threads:[~2022-09-28 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 22:05 [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Dmitry Torokhov
2022-09-27 22:05 ` [PATCH 2/2] usb: host: ehci-exynos: switch to using gpiod API Dmitry Torokhov
2022-09-28  6:55   ` Krzysztof Kozlowski
2022-09-30 11:52     ` Greg Kroah-Hartman
2022-09-28 15:15   ` Alan Stern [this message]
2022-09-30 12:25 ` (subset) [PATCH 1/2] ARM: dts: exynos: fix polarity of VBUS GPIO Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YzRlE3u7cIBL8Y1k@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=alim.akhtar@samsung.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).