usb: dwc3: gadget: use common is_selfpowered
authorPeter Chen <peter.chen@freescale.com>
Wed, 28 Jan 2015 08:32:40 +0000 (16:32 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 29 Jan 2015 16:35:40 +0000 (10:35 -0600)
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>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c

index 0842aa80976f20f667bc0ac01475d465ff19953a..d201910b892f9f9d068cdb1dab74551c3904b11c 100644 (file)
@@ -682,7 +682,6 @@ struct dwc3_scratchpad_array {
  * @is_utmi_l1_suspend: the core asserts output signal
  *     0       - utmi_sleep_n
  *     1       - utmi_l1_suspend_n
- * @is_selfpowered: true when we are selfpowered
  * @is_fpga: true when we are using the FPGA board
  * @needs_fifo_resize: not all users might want fifo resizing, flag it
  * @pullups_connected: true when Run/Stop bit is set
@@ -806,7 +805,6 @@ struct dwc3 {
        unsigned                has_hibernation:1;
        unsigned                has_lpm_erratum:1;
        unsigned                is_utmi_l1_suspend:1;
-       unsigned                is_selfpowered:1;
        unsigned                is_fpga:1;
        unsigned                needs_fifo_resize:1;
        unsigned                pullups_connected:1;
index 1bc77a3b499788803f125a94d5855c198ee9f634..2ef3c8d6a9dbd3b5b8270cb5af230d793e0d7230 100644 (file)
@@ -344,7 +344,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
                /*
                 * LTM will be set once we know how to set this in HW.
                 */
-               usb_status |= dwc->is_selfpowered << USB_DEVICE_SELF_POWERED;
+               usb_status |= dwc->gadget.is_selfpowered;
 
                if (dwc->speed == DWC3_DSTS_SUPERSPEED) {
                        reg = dwc3_readl(dwc->regs, DWC3_DCTL);
index eccd29b1684081bfb652b5b4c684b6454decd7d2..a03a485205c787c74812f14337096b2831223cbc 100644 (file)
@@ -1415,7 +1415,7 @@ static int dwc3_gadget_set_selfpowered(struct usb_gadget *g,
        unsigned long           flags;
 
        spin_lock_irqsave(&dwc->lock, flags);
-       dwc->is_selfpowered = !!is_selfpowered;
+       g->is_selfpowered = !!is_selfpowered;
        spin_unlock_irqrestore(&dwc->lock, flags);
 
        return 0;