[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <30907273.148421363318130664.JavaMail.weblogic@epv6ml07>
Date: Fri, 15 Mar 2013 03:28:54 +0000 (GMT)
From: Jingoo Han <jg1.han@...sung.com>
To: Doug Anderson <dianders@...omium.org>, Felipe Balbi <balbi@...com>
Cc: Alexander Graf <agraf@...e.de>,
Vivek Gautam <gautam.vivek@...sung.com>,
Jingoo Han <jg1.han@...sung.com>,
Alan Stern <stern@...land.harvard.edu>,
Kukjin Kim <kgene.kim@...sung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Abraham <thomas.abraham@...aro.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] usb: ehci-s5p: Use devm for requesting ehci_vbus_gpio
On Friday, March 15, 2013 12:16 PM, 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@...omium.org>
Acked-by: Jingoo Han <jg1.han@...sung.com>
Best regards,
Jingoo Han
> ---
> 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
Powered by blists - more mailing lists