diff options
author | Doug Anderson <dianders@chromium.org> | 2013-03-14 23:15:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-18 19:10:12 -0400 |
commit | 3f3b55bf7833d81d00c793d722e2af58d3b12963 (patch) | |
tree | db82d5e00dc53e3de668c22f14f56efd1826a321 /drivers/usb/host/ehci-s5p.c | |
parent | 24b90814fb133bb7971aef8ea5e642d9f9bc4b0b (diff) |
usb: ehci-s5p: Use devm for requesting ehci_vbus_gpio
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: Jingoo Han <jg1.han@samsung.com>
Tested-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-s5p.c')
-rw-r--r-- | drivers/usb/host/ehci-s5p.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 20ebf6a8b7f4..738490e6d429 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) | |||
92 | 92 | ||
93 | static void s5p_setup_vbus_gpio(struct platform_device *pdev) | 93 | static void s5p_setup_vbus_gpio(struct platform_device *pdev) |
94 | { | 94 | { |
95 | struct device *dev = &pdev->dev; | ||
95 | int err; | 96 | int err; |
96 | int gpio; | 97 | int gpio; |
97 | 98 | ||
98 | if (!pdev->dev.of_node) | 99 | if (!dev->of_node) |
99 | return; | 100 | return; |
100 | 101 | ||
101 | gpio = of_get_named_gpio(pdev->dev.of_node, | 102 | gpio = of_get_named_gpio(dev->of_node, "samsung,vbus-gpio", 0); |
102 | "samsung,vbus-gpio", 0); | ||
103 | if (!gpio_is_valid(gpio)) | 103 | if (!gpio_is_valid(gpio)) |
104 | return; | 104 | return; |
105 | 105 | ||
106 | err = gpio_request_one(gpio, GPIOF_OUT_INIT_HIGH, "ehci_vbus_gpio"); | 106 | err = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_HIGH, |
107 | "ehci_vbus_gpio"); | ||
107 | if (err) | 108 | if (err) |
108 | dev_err(&pdev->dev, "can't request ehci vbus gpio %d", gpio); | 109 | dev_err(dev, "can't request ehci vbus gpio %d", gpio); |
109 | } | 110 | } |
110 | 111 | ||
111 | static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32); | 112 | static u64 ehci_s5p_dma_mask = DMA_BIT_MASK(32); |