diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 5df0b0e3392b..77afabc77f9b 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -139,8 +139,23 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
139 | } | 139 | } |
140 | 140 | ||
141 | iclk = clk_get(&pdev->dev, "ohci_clk"); | 141 | iclk = clk_get(&pdev->dev, "ohci_clk"); |
142 | if (IS_ERR(iclk)) { | ||
143 | dev_err(&pdev->dev, "failed to get ohci_clk\n"); | ||
144 | retval = PTR_ERR(iclk); | ||
145 | goto err3; | ||
146 | } | ||
142 | fclk = clk_get(&pdev->dev, "uhpck"); | 147 | fclk = clk_get(&pdev->dev, "uhpck"); |
148 | if (IS_ERR(fclk)) { | ||
149 | dev_err(&pdev->dev, "failed to get uhpck\n"); | ||
150 | retval = PTR_ERR(fclk); | ||
151 | goto err4; | ||
152 | } | ||
143 | hclk = clk_get(&pdev->dev, "hclk"); | 153 | hclk = clk_get(&pdev->dev, "hclk"); |
154 | if (IS_ERR(hclk)) { | ||
155 | dev_err(&pdev->dev, "failed to get hclk\n"); | ||
156 | retval = PTR_ERR(hclk); | ||
157 | goto err5; | ||
158 | } | ||
144 | 159 | ||
145 | at91_start_hc(pdev); | 160 | at91_start_hc(pdev); |
146 | ohci_hcd_init(hcd_to_ohci(hcd)); | 161 | ohci_hcd_init(hcd_to_ohci(hcd)); |
@@ -153,9 +168,12 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
153 | at91_stop_hc(pdev); | 168 | at91_stop_hc(pdev); |
154 | 169 | ||
155 | clk_put(hclk); | 170 | clk_put(hclk); |
171 | err5: | ||
156 | clk_put(fclk); | 172 | clk_put(fclk); |
173 | err4: | ||
157 | clk_put(iclk); | 174 | clk_put(iclk); |
158 | 175 | ||
176 | err3: | ||
159 | iounmap(hcd->regs); | 177 | iounmap(hcd->regs); |
160 | 178 | ||
161 | err2: | 179 | err2: |
@@ -226,7 +244,8 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int | |||
226 | if (!gpio_is_valid(pdata->vbus_pin[port])) | 244 | if (!gpio_is_valid(pdata->vbus_pin[port])) |
227 | return; | 245 | return; |
228 | 246 | ||
229 | gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable); | 247 | gpio_set_value(pdata->vbus_pin[port], |
248 | !pdata->vbus_pin_active_low[port] ^ enable); | ||
230 | } | 249 | } |
231 | 250 | ||
232 | static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) | 251 | static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) |
@@ -237,7 +256,8 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port) | |||
237 | if (!gpio_is_valid(pdata->vbus_pin[port])) | 256 | if (!gpio_is_valid(pdata->vbus_pin[port])) |
238 | return -EINVAL; | 257 | return -EINVAL; |
239 | 258 | ||
240 | return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted; | 259 | return gpio_get_value(pdata->vbus_pin[port]) ^ |
260 | !pdata->vbus_pin_active_low[port]; | ||
241 | } | 261 | } |
242 | 262 | ||
243 | /* | 263 | /* |