All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] USB: Gadget: fsl driver pullup fix
  2014-03-20 20:27 [PATCH v2] USB: Gadget: fsl driver pullup fix Suresh Gupta
@ 2014-03-20 16:03 ` Greg KH
  2014-03-21  5:11   ` suresh.gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2014-03-20 16:03 UTC (permalink / raw)
  To: Suresh Gupta; +Cc: balbi, linux-usb, linux-kernel

On Fri, Mar 21, 2014 at 01:57:18AM +0530, Suresh Gupta wrote:
> This fix the fsl usb gadget driver in a way that the usb device
> will be only "pulled up" on requests only when vbus is powered
> 
> Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com>
> ---
> Changes from previous version:
> * Removed re-factored code, Will send another patch for re-factoring
>   duplicated code
> * Changed Description 
> 
>  drivers/usb/gadget/fsl_udc_core.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
> index 35cb972..49d66779 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
>  	struct fsl_udc *udc;
>  
>  	udc = container_of(gadget, struct fsl_udc, gadget);
> +
> +	if(!udc->vbus_active)
> +		return -EOPNOTSUPP;

Always run your patches through scripts/checkpatch.pl so they don't get
rejected for silly things like the wrong coding style...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] USB: Gadget: fsl driver pullup fix
@ 2014-03-20 20:27 Suresh Gupta
  2014-03-20 16:03 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Suresh Gupta @ 2014-03-20 20:27 UTC (permalink / raw)
  To: balbi, gregkh; +Cc: linux-usb, linux-kernel, Suresh Gupta

This fix the fsl usb gadget driver in a way that the usb device
will be only "pulled up" on requests only when vbus is powered

Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com>
---
Changes from previous version:
* Removed re-factored code, Will send another patch for re-factoring
  duplicated code
* Changed Description 

 drivers/usb/gadget/fsl_udc_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 35cb972..49d66779 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget, int is_on)
 	struct fsl_udc *udc;
 
 	udc = container_of(gadget, struct fsl_udc, gadget);
+
+	if(!udc->vbus_active)
+		return -EOPNOTSUPP;
+
 	udc->softconnect = (is_on != 0);
 	if (can_pullup(udc))
 		fsl_writel((fsl_readl(&dr_regs->usbcmd) | USB_CMD_RUN_STOP),
-- 
1.8.4.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH v2] USB: Gadget: fsl driver pullup fix
  2014-03-20 16:03 ` Greg KH
@ 2014-03-21  5:11   ` suresh.gupta
  0 siblings, 0 replies; 3+ messages in thread
From: suresh.gupta @ 2014-03-21  5:11 UTC (permalink / raw)
  To: Greg KH; +Cc: balbi, linux-usb, linux-kernel



> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Thursday, March 20, 2014 9:33 PM
> To: Gupta Suresh-B42813
> Cc: balbi@ti.com; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v2] USB: Gadget: fsl driver pullup fix
> 
> On Fri, Mar 21, 2014 at 01:57:18AM +0530, Suresh Gupta wrote:
> > This fix the fsl usb gadget driver in a way that the usb device will
> > be only "pulled up" on requests only when vbus is powered
> >
> > Signed-off-by: Suresh Gupta <suresh.gupta@freescale.com>
> > ---
> > Changes from previous version:
> > * Removed re-factored code, Will send another patch for re-factoring
> >   duplicated code
> > * Changed Description
> >
> >  drivers/usb/gadget/fsl_udc_core.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/usb/gadget/fsl_udc_core.c
> > b/drivers/usb/gadget/fsl_udc_core.c
> > index 35cb972..49d66779 100644
> > --- a/drivers/usb/gadget/fsl_udc_core.c
> > +++ b/drivers/usb/gadget/fsl_udc_core.c
> > @@ -1219,6 +1219,10 @@ static int fsl_pullup(struct usb_gadget *gadget,
> int is_on)
> >  	struct fsl_udc *udc;
> >
> >  	udc = container_of(gadget, struct fsl_udc, gadget);
> > +
> > +	if(!udc->vbus_active)
> > +		return -EOPNOTSUPP;
> 
> Always run your patches through scripts/checkpatch.pl so they don't get
> rejected for silly things like the wrong coding style...
> 
Accepted, Sorry for such a inane mistake 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-21  5:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-20 20:27 [PATCH v2] USB: Gadget: fsl driver pullup fix Suresh Gupta
2014-03-20 16:03 ` Greg KH
2014-03-21  5:11   ` suresh.gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.