USB: android gadget: queue the request only when serial is online

As a part of comp switch serial driver may queue the request
during serial unregistration, since serial unregistration is not
happening in atomic context.

Add variable to maintain serial driver state and verify that
variable before queuing the request.

Signed-off-by: Anji Jonnala <anjir@qualcomm.com>
This commit is contained in:
Anji Jonnala 2009-07-31 17:43:21 +05:30 committed by Stephen Boyd
parent f2fbda6175
commit 602b4dcc05

View file

@ -32,6 +32,7 @@ struct f_gser {
u8 data_id;
u8 port_num;
u8 online;
#ifdef CONFIG_MODEM_SUPPORT
u8 pending;
spinlock_t lock;
@ -385,6 +386,7 @@ static int gser_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
}
}
gserial_connect(&gser->port, gser->port_num);
gser->online = 1;
return rc;
}
@ -400,6 +402,7 @@ static void gser_disable(struct usb_function *f)
usb_ep_fifo_flush(gser->notify);
usb_ep_disable(gser->notify);
#endif
gser->online = 0;
}
#ifdef CONFIG_MODEM_SUPPORT
static int gser_notify(struct f_gser *gser, u8 type, u16 value,