Hi, On Thu, Jun 16, 2011 at 04:31:04PM +0300, Tatyana Brokhman wrote: > @@ -1362,6 +1363,43 @@ static struct dummy_ep *find_endpoint (struct dummy *dum, u8 address) > #define Ep_Request (USB_TYPE_STANDARD | USB_RECIP_ENDPOINT) > #define Ep_InRequest (Ep_Request | USB_DIR_IN) > > +/** > + * dummy_hcd_conn_disc_work() - performs a disconnect/connect sequence. > + * @data: pointer to the sceduled work_struct > + */ > +static void dummy_hcd_conn_disc_work(struct work_struct *data) > +{ > + struct dummy_hcd *dum_hcd = > + container_of(data, struct dummy_hcd, conn_disc_work); > + int ret_val; > + > + if (!dum_hcd->dum->driver) { > + dev_err(dummy_dev(dum_hcd), > + "dummy_hcd_conn_disc_work called without connected " > + "device\n"); > + return; > + } > + > + dev_info(dummy_dev(dum_hcd), "disconnecting device...\n"); > + ret_val = dummy_pullup(&dum_hcd->dum->gadget, 0); > + if (ret_val) { > + dev_err(dummy_dev(dum_hcd), "dummy_hcd_conn_disc_work:" > + " couldn't disconnect device:" > + " ret_val=%d\n", > + ret_val); > + return; > + } > + > + dev_info(dummy_dev(dum_hcd), "re-connecting device...\n"); > + /* We have to let the hub task to update the device disconnect state */ > + msleep_interruptible(1000); > + ret_val = dummy_pullup(&dum_hcd->dum->gadget, 1); > + if (ret_val) > + dev_err(dummy_dev(dum_hcd), "dummy_hcd_conn_disc_work:" > + " couldn't re-connect device:" > + " ret_val=%d\n", > + ret_val); this print is quite ugly. How about something like: dev_err(dummy_dev(dum_hcd), "%s: couldn't re-connect --> %d\n", __func__, ret_val); ??? -- balbi
Attachment:
signature.asc
Description: Digital signature