diff options
Diffstat (limited to 'drivers/usb/gadget/udc/net2272.c')
-rw-r--r-- | drivers/usb/gadget/udc/net2272.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c index d20de1fab08e..195baf3e1fcd 100644 --- a/drivers/usb/gadget/udc/net2272.c +++ b/drivers/usb/gadget/udc/net2272.c | |||
@@ -1132,13 +1132,10 @@ net2272_wakeup(struct usb_gadget *_gadget) | |||
1132 | static int | 1132 | static int |
1133 | net2272_set_selfpowered(struct usb_gadget *_gadget, int value) | 1133 | net2272_set_selfpowered(struct usb_gadget *_gadget, int value) |
1134 | { | 1134 | { |
1135 | struct net2272 *dev; | ||
1136 | |||
1137 | if (!_gadget) | 1135 | if (!_gadget) |
1138 | return -ENODEV; | 1136 | return -ENODEV; |
1139 | dev = container_of(_gadget, struct net2272, gadget); | ||
1140 | 1137 | ||
1141 | dev->is_selfpowered = value; | 1138 | _gadget->is_selfpowered = (value != 0); |
1142 | 1139 | ||
1143 | return 0; | 1140 | return 0; |
1144 | } | 1141 | } |
@@ -1844,7 +1841,7 @@ net2272_handle_stat0_irqs(struct net2272 *dev, u8 stat) | |||
1844 | case USB_RECIP_DEVICE: | 1841 | case USB_RECIP_DEVICE: |
1845 | if (u.r.wLength > 2) | 1842 | if (u.r.wLength > 2) |
1846 | goto do_stall; | 1843 | goto do_stall; |
1847 | if (dev->is_selfpowered) | 1844 | if (dev->gadget.is_selfpowered) |
1848 | status = (1 << USB_DEVICE_SELF_POWERED); | 1845 | status = (1 << USB_DEVICE_SELF_POWERED); |
1849 | 1846 | ||
1850 | /* don't bother with a request object! */ | 1847 | /* don't bother with a request object! */ |