mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kukjin Kim <kgene.kim@samsung.com>
To: "'Doug Anderson'" <dianders@chromium.org>,
	"'Felipe Balbi'" <balbi@ti.com>
Cc: "'Alexander Graf'" <agraf@suse.de>,
	"'Vivek Gautam'" <gautam.vivek@samsung.com>,
	"'Jingoo Han'" <jg1.han@samsung.com>,
	"'Alan Stern'" <stern@rowland.harvard.edu>,
	"'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
	"'Thomas Abraham'" <thomas.abraham@linaro.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RE: [PATCH v2] usb: ehci-s5p: Use devm for requesting ehci_vbus_gpio
Date: Mon, 25 Mar 2013 18:29:17 +0900	[thread overview]
Message-ID: <176701ce293b$38b41ba0$aa1c52e0$%kim@samsung.com> (raw)
In-Reply-To: <1363317337-7316-1-git-send-email-dianders@chromium.org>

Doug Anderson wrote:
> 
> The ehci_vbus_gpio is requested but never freed.  This can cause
> problems with deferred probes and would cause problems if
> s5p_ehci_remove was ever called.  Use devm to fix this.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>

Acked-by: Kukjin Kim <kgene.kim@samsung.com>

Thanks.

- Kukjin

> ---
> Changes in v2:
> - &pdev->dev => dev elsewhere in s5p_setup_vbus_gpio()
> 
>  drivers/usb/host/ehci-s5p.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
> index 20ebf6a..738490e 100644
> --- a/drivers/usb/host/ehci-s5p.c
> +++ b/drivers/usb/host/ehci-s5p.c
> @@ -92,20 +92,21 @@ static void s5p_ehci_phy_disable(struct s5p_ehci_hcd
> *s5p_ehci)
> 
>  static void s5p_setup_vbus_gpio(struct platform_device *pdev)
>  {
> +	struct device *dev = &pdev->dev;
>  	int err;
>  	int gpio;
> 
> -	if (!pdev->dev.of_node)
> +	if (!dev->of_node)
>  		return;
> 
> -	gpio = of_get_named_gpio(pdev->dev.of_node,
> -			"samsung,vbus-gpio", 0);
> +	gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0);
>  	if (!gpio_is_valid(gpio))
>  		return;
> 
> -	err = gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "ehci_vbus_gpio");
> +	err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH,
> +				    "ehci_vbus_gpio");
>  	if (err)
> -		dev_err(&pdev->dev, "can't request ehci vbus gpio %d",
gpio);
> +		dev_err(dev, "can't request ehci vbus gpio %d", gpio);
>  }
> 
>  static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32);
> --
> 1.8.1.3


  reply	other threads:[~2013-03-25  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 23:59 [PATCH] " Doug Anderson
2013-03-15  3:15 ` [PATCH v2] " Doug Anderson
2013-03-25  9:29   ` Kukjin Kim [this message]
2013-03-15  3:28 Jingoo Han
2013-03-18 13:48 ` Vivek Gautam

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='176701ce293b$38b41ba0$aa1c52e0$%kim@samsung.com' \
    --to=kgene.kim@samsung.com \
    --cc=agraf@suse.de \
    --cc=balbi@ti.com \
    --cc=dianders@chromium.org \
    --cc=gautam.vivek@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=thomas.abraham@linaro.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

all inboxes | Powered by JetHome®