]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: gadget: at91_udc: use common is_selfpowered
authorPeter Chen <peter.chen@freescale.com>
Wed, 28 Jan 2015 08:32:26 +0000 (16:32 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 29 Jan 2015 16:32:45 +0000 (10:32 -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/gadget/udc/at91_udc.c
drivers/usb/gadget/udc/at91_udc.h

index c862656d18b886938d35edf0ab4623bb5ed54f6e..c0ec5f71f16fca67e7fd2880c6e60ac2c9a8523f 100644 (file)
@@ -176,7 +176,7 @@ static int proc_udc_show(struct seq_file *s, void *unused)
                udc->enabled
                        ? (udc->vbus ? "active" : "enabled")
                        : "disabled",
-               udc->selfpowered ? "self" : "VBUS",
+               udc->gadget.is_selfpowered ? "self" : "VBUS",
                udc->suspended ? ", suspended" : "",
                udc->driver ? udc->driver->driver.name : "(none)");
 
@@ -1000,7 +1000,7 @@ static int at91_set_selfpowered(struct usb_gadget *gadget, int is_on)
        unsigned long   flags;
 
        spin_lock_irqsave(&udc->lock, flags);
-       udc->selfpowered = (is_on != 0);
+       gadget->is_selfpowered = (is_on != 0);
        spin_unlock_irqrestore(&udc->lock, flags);
        return 0;
 }
@@ -1149,7 +1149,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr)
         */
        case ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE) << 8)
                        | USB_REQ_GET_STATUS:
-               tmp = (udc->selfpowered << USB_DEVICE_SELF_POWERED);
+               tmp = (udc->gadget.is_selfpowered << USB_DEVICE_SELF_POWERED);
                if (at91_udp_read(udc, AT91_UDP_GLB_STAT) & AT91_UDP_ESR)
                        tmp |= (1 << USB_DEVICE_REMOTE_WAKEUP);
                PACKET("get device status\n");
@@ -1653,7 +1653,7 @@ static int at91_start(struct usb_gadget *gadget,
        udc->driver = driver;
        udc->gadget.dev.of_node = udc->pdev->dev.of_node;
        udc->enabled = 1;
-       udc->selfpowered = 1;
+       udc->gadget.is_selfpowered = 1;
 
        return 0;
 }
index 01752466338164e898b48a511078c5b2252b15a7..467dcfb74a5110219aea6ab1037c788b22422745 100644 (file)
@@ -122,7 +122,6 @@ struct at91_udc {
        unsigned                        req_pending:1;
        unsigned                        wait_for_addr_ack:1;
        unsigned                        wait_for_config_ack:1;
-       unsigned                        selfpowered:1;
        unsigned                        active_suspend:1;
        u8                              addr;
        struct at91_udc_data            board;