summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-01-28 09:32:27 +0100
committerFelipe Balbi <balbi@ti.com>2015-01-29 17:32:48 +0100
commit9239d88fc5e58a2a72bc949362f999aac9bffb29 (patch)
treec7ee39aed5e5cb83fa019ce85e8ebb1bb268c1a1
parentusb: gadget: at91_udc: use common is_selfpowered (diff)
downloadlinux-9239d88fc5e58a2a72bc949362f999aac9bffb29.tar.xz
linux-9239d88fc5e58a2a72bc949362f999aac9bffb29.zip
staging: emxx_udc: 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>
-rw-r--r--drivers/staging/emxx_udc/emxx_udc.c9
-rw-r--r--drivers/staging/emxx_udc/emxx_udc.h1
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index eb178fcb7954..1d3135a33258 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -1608,7 +1608,7 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
switch (recipient) {
case USB_RECIP_DEVICE:
if (udc->ctrl.wIndex == 0x0000) {
- if (udc->self_powered)
+ if (udc->gadget.is_selfpowered)
status_data |= (1 << USB_DEVICE_SELF_POWERED);
if (udc->remote_wakeup)
@@ -3117,7 +3117,6 @@ static int nbu2ss_gad_wakeup(struct usb_gadget *pgadget)
static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget,
int is_selfpowered)
{
- struct nbu2ss_udc *udc;
unsigned long flags;
/* INFO("=== %s()\n", __func__); */
@@ -3127,10 +3126,8 @@ static int nbu2ss_gad_set_selfpowered(struct usb_gadget *pgadget,
return -EINVAL;
}
- udc = container_of(pgadget, struct nbu2ss_udc, gadget);
-
spin_lock_irqsave(&udc->lock, flags);
- udc->self_powered = (is_selfpowered != 0);
+ pgadget->is_selfpowered = (is_selfpowered != 0);
spin_unlock_irqrestore(&udc->lock, flags);
return 0;
@@ -3308,7 +3305,7 @@ static int __init nbu2ss_drv_contest_init(
spin_lock_init(&udc->lock);
udc->dev = &pdev->dev;
- udc->self_powered = 1;
+ udc->gadget.is_selfpowered = 1;
udc->devstate = USB_STATE_NOTATTACHED;
udc->pdev = pdev;
udc->mA = 0;
diff --git a/drivers/staging/emxx_udc/emxx_udc.h b/drivers/staging/emxx_udc/emxx_udc.h
index ee1b80d705fa..202e2dc72bba 100644
--- a/drivers/staging/emxx_udc/emxx_udc.h
+++ b/drivers/staging/emxx_udc/emxx_udc.h
@@ -624,7 +624,6 @@ struct nbu2ss_udc {
unsigned linux_suspended:1;
unsigned linux_resume:1;
unsigned usb_suspended:1;
- unsigned self_powered:1;
unsigned remote_wakeup:1;
unsigned udc_enabled:1;