Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141796
b: refs/heads/master
c: 472a678
h: refs/heads/master
v: v3
  • Loading branch information
Hans-Christian Egtvedt authored and Haavard Skinnemoen committed Mar 26, 2009
1 parent c765557 commit cddbd4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: b2a49ed0083ec5f51e9e0ed2e739b9b6259e330c
refs/heads/master: 472a6786b071ea88144e09eeb9b2a77549d98e75
14 changes: 7 additions & 7 deletions trunk/drivers/usb/gadget/atmel_usba_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static inline void usba_cleanup_debugfs(struct usba_udc *udc)

static int vbus_is_present(struct usba_udc *udc)
{
if (udc->vbus_pin != -1)
if (gpio_is_valid(udc->vbus_pin))
return gpio_get_value(udc->vbus_pin);

/* No Vbus detection: Assume always present */
Expand Down Expand Up @@ -1821,7 +1821,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
DBG(DBG_GADGET, "registered driver `%s'\n", driver->driver.name);

udc->vbus_prev = 0;
if (udc->vbus_pin != -1)
if (gpio_is_valid(udc->vbus_pin))
enable_irq(gpio_to_irq(udc->vbus_pin));

/* If Vbus is present, enable the controller and wait for reset */
Expand Down Expand Up @@ -1852,7 +1852,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
if (driver != udc->driver || !driver->unbind)
return -EINVAL;

if (udc->vbus_pin != -1)
if (gpio_is_valid(udc->vbus_pin))
disable_irq(gpio_to_irq(udc->vbus_pin));

spin_lock_irqsave(&udc->lock, flags);
Expand Down Expand Up @@ -1910,7 +1910,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
udc->pdev = pdev;
udc->pclk = pclk;
udc->hclk = hclk;
udc->vbus_pin = -1;
udc->vbus_pin = -ENODEV;

ret = -ENOMEM;
udc->regs = ioremap(regs->start, regs->end - regs->start + 1);
Expand Down Expand Up @@ -1996,7 +1996,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
goto err_device_add;
}

if (pdata->vbus_pin >= 0) {
if (gpio_is_valid(pdata->vbus_pin)) {
if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) {
udc->vbus_pin = pdata->vbus_pin;

Expand All @@ -2005,7 +2005,7 @@ static int __init usba_udc_probe(struct platform_device *pdev)
"atmel_usba_udc", udc);
if (ret) {
gpio_free(udc->vbus_pin);
udc->vbus_pin = -1;
udc->vbus_pin = -ENODEV;
dev_warn(&udc->pdev->dev,
"failed to request vbus irq; "
"assuming always on\n");
Expand Down Expand Up @@ -2051,7 +2051,7 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
usba_ep_cleanup_debugfs(&usba_ep[i]);
usba_cleanup_debugfs(udc);

if (udc->vbus_pin != -1)
if (gpio_is_valid(udc->vbus_pin))
gpio_free(udc->vbus_pin);

free_irq(udc->irq, udc);
Expand Down

0 comments on commit cddbd4b

Please sign in to comment.