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>
This commit is contained in:
parent
b3764dd1a3
commit
d4a1c47946
|
@ -1132,13 +1132,10 @@ net2272_wakeup(struct usb_gadget *_gadget)
|
||||||
static int
|
static int
|
||||||
net2272_set_selfpowered(struct usb_gadget *_gadget, int value)
|
net2272_set_selfpowered(struct usb_gadget *_gadget, int value)
|
||||||
{
|
{
|
||||||
struct net2272 *dev;
|
|
||||||
|
|
||||||
if (!_gadget)
|
if (!_gadget)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
dev = container_of(_gadget, struct net2272, gadget);
|
|
||||||
|
|
||||||
dev->is_selfpowered = value;
|
_gadget->is_selfpowered = (value != 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1844,7 +1841,7 @@ net2272_handle_stat0_irqs(struct net2272 *dev, u8 stat)
|
||||||
case USB_RECIP_DEVICE:
|
case USB_RECIP_DEVICE:
|
||||||
if (u.r.wLength > 2)
|
if (u.r.wLength > 2)
|
||||||
goto do_stall;
|
goto do_stall;
|
||||||
if (dev->is_selfpowered)
|
if (dev->gadget.is_selfpowered)
|
||||||
status = (1 << USB_DEVICE_SELF_POWERED);
|
status = (1 << USB_DEVICE_SELF_POWERED);
|
||||||
|
|
||||||
/* don't bother with a request object! */
|
/* don't bother with a request object! */
|
||||||
|
|
|
@ -458,7 +458,6 @@ struct net2272 {
|
||||||
struct usb_gadget_driver *driver;
|
struct usb_gadget_driver *driver;
|
||||||
unsigned protocol_stall:1,
|
unsigned protocol_stall:1,
|
||||||
softconnect:1,
|
softconnect:1,
|
||||||
is_selfpowered:1,
|
|
||||||
wakeup:1,
|
wakeup:1,
|
||||||
dma_eot_polarity:1,
|
dma_eot_polarity:1,
|
||||||
dma_dack_polarity:1,
|
dma_dack_polarity:1,
|
||||||
|
|
Loading…
Reference in New Issue