Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340670
b: refs/heads/master
c: 6f0a098
h: refs/heads/master
v: v3
  • Loading branch information
Ming Lei authored and David S. Miller committed Nov 7, 2012
1 parent 7873ca5 commit ea77e09
Show file tree
Hide file tree
Showing 2 changed files with 17 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: ec32115db2bcb7133171c6a036107ca7eb62267f
refs/heads/master: 6f0a0986e328dd61610d898a09c9f4aa960ae64a
20 changes: 16 additions & 4 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,8 +1670,14 @@ static int __usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, void *data, u16 size)
{
return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
data, size);
int ret;

if (usb_autopm_get_interface(dev->intf) < 0)
return -ENODEV;
ret = __usbnet_read_cmd(dev, cmd, reqtype, value, index,
data, size);
usb_autopm_put_interface(dev->intf);
return ret;
}
EXPORT_SYMBOL_GPL(usbnet_read_cmd);

Expand All @@ -1682,8 +1688,14 @@ EXPORT_SYMBOL_GPL(usbnet_read_cmd);
int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, const void *data, u16 size)
{
return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
data, size);
int ret;

if (usb_autopm_get_interface(dev->intf) < 0)
return -ENODEV;
ret = __usbnet_write_cmd(dev, cmd, reqtype, value, index,
data, size);
usb_autopm_put_interface(dev->intf);
return ret;
}
EXPORT_SYMBOL_GPL(usbnet_write_cmd);

Expand Down

0 comments on commit ea77e09

Please sign in to comment.