usb: musb: gadget: use common is_selfpowered
authorPeter Chen <peter.chen@freescale.com>
Wed, 28 Jan 2015 08:32:41 +0000 (16:32 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 29 Jan 2015 16:35:43 +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/musb/musb_gadget.c
drivers/usb/musb/musb_gadget_ep0.c

index 49b04cb6f5ca6acef7748f2945f1e0cd3230590c..b2d9040c7685ba6a63ebcfa4ec59676e931369b1 100644 (file)
@@ -1612,9 +1612,7 @@ done:
 static int
 musb_gadget_set_self_powered(struct usb_gadget *gadget, int is_selfpowered)
 {
-       struct musb     *musb = gadget_to_musb(gadget);
-
-       musb->is_self_powered = !!is_selfpowered;
+       gadget->is_selfpowered = !!is_selfpowered;
        return 0;
 }
 
index 2af45a0c8930b35ca645834c157291198c383aca..10d30afe4a3c41469930dd7ea5ac3d57b790c4d6 100644 (file)
@@ -85,7 +85,7 @@ static int service_tx_status_request(
 
        switch (recip) {
        case USB_RECIP_DEVICE:
-               result[0] = musb->is_self_powered << USB_DEVICE_SELF_POWERED;
+               result[0] = musb->g.is_selfpowered << USB_DEVICE_SELF_POWERED;
                result[0] |= musb->may_wakeup << USB_DEVICE_REMOTE_WAKEUP;
                if (musb->g.is_otg) {
                        result[0] |= musb->g.b_hnp_enable