diff options
Diffstat (limited to 'drivers/usb/host/ehci-msm.c')
-rw-r--r-- | drivers/usb/host/ehci-msm.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 17dd9e94001e..4af4dc5b618c 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c | |||
@@ -133,7 +133,7 @@ static int ehci_msm_probe(struct platform_device *pdev) | |||
133 | 133 | ||
134 | hcd->rsrc_start = res->start; | 134 | hcd->rsrc_start = res->start; |
135 | hcd->rsrc_len = resource_size(res); | 135 | hcd->rsrc_len = resource_size(res); |
136 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | 136 | hcd->regs = devm_ioremap(&pdev->dev, hcd->rsrc_start, hcd->rsrc_len); |
137 | if (!hcd->regs) { | 137 | if (!hcd->regs) { |
138 | dev_err(&pdev->dev, "ioremap failed\n"); | 138 | dev_err(&pdev->dev, "ioremap failed\n"); |
139 | ret = -ENOMEM; | 139 | ret = -ENOMEM; |
@@ -145,17 +145,17 @@ static int ehci_msm_probe(struct platform_device *pdev) | |||
145 | * powering up VBUS, mapping of registers address space and power | 145 | * powering up VBUS, mapping of registers address space and power |
146 | * management. | 146 | * management. |
147 | */ | 147 | */ |
148 | phy = usb_get_phy(USB_PHY_TYPE_USB2); | 148 | phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2); |
149 | if (IS_ERR_OR_NULL(phy)) { | 149 | if (IS_ERR_OR_NULL(phy)) { |
150 | dev_err(&pdev->dev, "unable to find transceiver\n"); | 150 | dev_err(&pdev->dev, "unable to find transceiver\n"); |
151 | ret = -ENODEV; | 151 | ret = -ENODEV; |
152 | goto unmap; | 152 | goto put_hcd; |
153 | } | 153 | } |
154 | 154 | ||
155 | ret = otg_set_host(phy->otg, &hcd->self); | 155 | ret = otg_set_host(phy->otg, &hcd->self); |
156 | if (ret < 0) { | 156 | if (ret < 0) { |
157 | dev_err(&pdev->dev, "unable to register with transceiver\n"); | 157 | dev_err(&pdev->dev, "unable to register with transceiver\n"); |
158 | goto put_transceiver; | 158 | goto put_hcd; |
159 | } | 159 | } |
160 | 160 | ||
161 | device_init_wakeup(&pdev->dev, 1); | 161 | device_init_wakeup(&pdev->dev, 1); |
@@ -168,10 +168,6 @@ static int ehci_msm_probe(struct platform_device *pdev) | |||
168 | 168 | ||
169 | return 0; | 169 | return 0; |
170 | 170 | ||
171 | put_transceiver: | ||
172 | usb_put_phy(phy); | ||
173 | unmap: | ||
174 | iounmap(hcd->regs); | ||
175 | put_hcd: | 171 | put_hcd: |
176 | usb_put_hcd(hcd); | 172 | usb_put_hcd(hcd); |
177 | 173 | ||
@@ -187,7 +183,6 @@ static int __devexit ehci_msm_remove(struct platform_device *pdev) | |||
187 | pm_runtime_set_suspended(&pdev->dev); | 183 | pm_runtime_set_suspended(&pdev->dev); |
188 | 184 | ||
189 | otg_set_host(phy->otg, NULL); | 185 | otg_set_host(phy->otg, NULL); |
190 | usb_put_phy(phy); | ||
191 | 186 | ||
192 | usb_put_hcd(hcd); | 187 | usb_put_hcd(hcd); |
193 | 188 | ||