Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347321
b: refs/heads/master
c: a1c088e
h: refs/heads/master
i:
  347319: 1b0777b
v: v3
  • Loading branch information
Oliver Neukum authored and David S. Miller committed Dec 19, 2012
1 parent 84e942e commit 1f99e22
Show file tree
Hide file tree
Showing 3 changed files with 10 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: 4945106d21926eadaaa1c5465d26d9a0d26a2420
refs/heads/master: a1c088e01b71d90852b0df5a77cdae46bd0e0c05
15 changes: 8 additions & 7 deletions trunk/drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ int usbnet_stop (struct net_device *net)
dev->flags = 0;
del_timer_sync (&dev->delay);
tasklet_kill (&dev->bh);
if (info->manage_power)
if (info->manage_power &&
!test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags))
info->manage_power(dev, 0);
else
usb_autopm_put_interface(dev->intf);
Expand Down Expand Up @@ -794,14 +795,14 @@ int usbnet_open (struct net_device *net)
tasklet_schedule (&dev->bh);
if (info->manage_power) {
retval = info->manage_power(dev, 1);
if (retval < 0)
goto done_manage_power_error;
usb_autopm_put_interface(dev->intf);
if (retval < 0) {
retval = 0;
set_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
} else {
usb_autopm_put_interface(dev->intf);
}
}
return retval;

done_manage_power_error:
clear_bit(EVENT_DEV_OPEN, &dev->flags);
done:
usb_autopm_put_interface(dev->intf);
done_nopm:
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/usb/usbnet.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct usbnet {
# define EVENT_DEV_ASLEEP 6
# define EVENT_DEV_OPEN 7
# define EVENT_DEVICE_REPORT_IDLE 8
# define EVENT_NO_RUNTIME_PM 9
};

static inline struct usb_driver *driver_of(struct usb_interface *intf)
Expand Down

0 comments on commit 1f99e22

Please sign in to comment.