Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303979
b: refs/heads/master
c: 123bbce
h: refs/heads/master
i:
  303977: 6e0453f
  303975: d9913a2
v: v3
  • Loading branch information
Shinya Kuribayashi authored and Greg Kroah-Hartman committed May 17, 2012
1 parent 8ffc911 commit e9213a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: 8f9d973a0daee49e0b9b924c724b18b0170ec9cb
refs/heads/master: 123bbceebeb1174e385eab1fc2b2535dcdcc9ec3
10 changes: 6 additions & 4 deletions trunk/drivers/usb/otg/gpio_vbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct gpio_vbus_data {
unsigned mA;
struct delayed_work work;
int vbus;
int irq;
};


Expand Down Expand Up @@ -173,12 +174,11 @@ static int gpio_vbus_set_peripheral(struct usb_otg *otg,
struct gpio_vbus_data *gpio_vbus;
struct gpio_vbus_mach_info *pdata;
struct platform_device *pdev;
int gpio, irq;
int gpio;

gpio_vbus = container_of(otg->phy, struct gpio_vbus_data, phy);
pdev = to_platform_device(gpio_vbus->dev);
pdata = gpio_vbus->dev->platform_data;
irq = gpio_to_irq(pdata->gpio_vbus);
gpio = pdata->gpio_pullup;

if (!gadget) {
Expand All @@ -203,7 +203,7 @@ static int gpio_vbus_set_peripheral(struct usb_otg *otg,

/* initialize connection state */
gpio_vbus->vbus = 0; /* start with disconnected */
gpio_vbus_irq(irq, pdev);
gpio_vbus_irq(gpio_vbus->irq, pdev);
return 0;
}

Expand Down Expand Up @@ -284,6 +284,8 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
} else
irq = gpio_to_irq(gpio);

gpio_vbus->irq = irq;

/* if data line pullup is in use, initialize it to "not pulling up" */
gpio = pdata->gpio_pullup;
if (gpio_is_valid(gpio)) {
Expand Down Expand Up @@ -350,7 +352,7 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev)

usb_set_transceiver(NULL);

free_irq(gpio_to_irq(gpio), pdev);
free_irq(gpio_vbus->irq, pdev);
if (gpio_is_valid(pdata->gpio_pullup))
gpio_free(pdata->gpio_pullup);
gpio_free(gpio);
Expand Down

0 comments on commit e9213a7

Please sign in to comment.