Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281529
b: refs/heads/master
c: 8a7a49d
h: refs/heads/master
i:
  281527: 72c2459
v: v3
  • Loading branch information
Jean-Christophe PLAGNIOL-VILLARD authored and Arnd Bergmann committed Nov 29, 2011
1 parent 0ee8808 commit b80e28d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1d6dc0683d434c084ac067220c3e58d058c434a1
refs/heads/master: 8a7a49d18b6bc0a5fd6f356b09ef3d649c7f9010
12 changes: 6 additions & 6 deletions trunk/drivers/usb/host/ohci-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static void ohci_at91_usb_set_power(struct at91_usbh_data *pdata, int port, int
if (port < 0 || port >= 2)
return;

if (pdata->vbus_pin[port] <= 0)
if (!gpio_is_valid(pdata->vbus_pin[port]))
return;

gpio_set_value(pdata->vbus_pin[port], !pdata->vbus_pin_inverted ^ enable);
Expand All @@ -234,7 +234,7 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
if (port < 0 || port >= 2)
return -EINVAL;

if (pdata->vbus_pin[port] <= 0)
if (!gpio_is_valid(pdata->vbus_pin[port]))
return -EINVAL;

return gpio_get_value(pdata->vbus_pin[port]) ^ !pdata->vbus_pin_inverted;
Expand Down Expand Up @@ -465,7 +465,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)

if (pdata) {
for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
if (pdata->vbus_pin[i] <= 0)
if (!gpio_is_valid(pdata->vbus_pin[i]))
continue;
gpio_request(pdata->vbus_pin[i], "ohci_vbus");
ohci_at91_usb_set_power(pdata, i, 1);
Expand All @@ -474,7 +474,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) {
int ret;

if (pdata->overcurrent_pin[i] <= 0)
if (!gpio_is_valid(pdata->overcurrent_pin[i]))
continue;
gpio_request(pdata->overcurrent_pin[i], "ohci_overcurrent");

Expand All @@ -499,14 +499,14 @@ static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)

if (pdata) {
for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) {
if (pdata->vbus_pin[i] <= 0)
if (!gpio_is_valid(pdata->vbus_pin[i]))
continue;
ohci_at91_usb_set_power(pdata, i, 0);
gpio_free(pdata->vbus_pin[i]);
}

for (i = 0; i < ARRAY_SIZE(pdata->overcurrent_pin); i++) {
if (pdata->overcurrent_pin[i] <= 0)
if (!gpio_is_valid(pdata->overcurrent_pin[i]))
continue;
free_irq(gpio_to_irq(pdata->overcurrent_pin[i]), pdev);
gpio_free(pdata->overcurrent_pin[i]);
Expand Down

0 comments on commit b80e28d

Please sign in to comment.