diff options
author | Peter Chen <peter.chen@freescale.com> | 2015-01-28 16:32:37 +0800 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-29 10:35:27 -0600 |
commit | d4a1c47946a2796520a95da6bed8e5642ce9fb19 (patch) | |
tree | a4a322ed3493261b5f2aecda2fe9dcf1debf1f46 /drivers/usb/gadget/udc/net2272.c | |
parent | b3764dd1a318a227099984a4406f47f861b1d6eb (diff) | |
download | op-kernel-dev-d4a1c47946a2796520a95da6bed8e5642ce9fb19.zip op-kernel-dev-d4a1c47946a2796520a95da6bed8e5642ce9fb19.tar.gz |
usb: gadget: net2272: use common is_selfpowered
Delete private selfpowered variable, and use common one.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 d20de1f..195baf3 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) static int net2272_set_selfpowered(struct usb_gadget *_gadget, int value) { - struct net2272 *dev; - if (!_gadget) return -ENODEV; - dev = container_of(_gadget, struct net2272, gadget); - dev->is_selfpowered = value; + _gadget->is_selfpowered = (value != 0); return 0; } @@ -1844,7 +1841,7 @@ net2272_handle_stat0_irqs(struct net2272 *dev, u8 stat) case USB_RECIP_DEVICE: if (u.r.wLength > 2) goto do_stall; - if (dev->is_selfpowered) + if (dev->gadget.is_selfpowered) status = (1 << USB_DEVICE_SELF_POWERED); /* don't bother with a request object! */ |