Hi Ajay,

On Mon, Oct 21, 2019 at 07:28:36PM +0000, Ajay Gupta wrote:
> Hi Heikki,
> 
> > -----Original Message-----
> > From: linux-usb-ow...@vger.kernel.org <linux-usb-ow...@vger.kernel.org>
> > On Behalf Of Heikki Krogerus
> > Sent: Monday, October 21, 2019 4:25 AM
> > To: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> > Cc: Guenter Roeck <li...@roeck-us.net>; Ajay Gupta <aj...@nvidia.com>;
> > linux-usb@vger.kernel.org
> > Subject: [PATCH 14/18] usb: typec: ucsi: Remove the old API
> > 
> > The drivers now only use the new API, so removing the old one.
> > 
> > Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com>
> > ---
> >  drivers/usb/typec/ucsi/displayport.c |  24 +-
> >  drivers/usb/typec/ucsi/trace.h       |  17 --
> >  drivers/usb/typec/ucsi/ucsi.c        | 345 +++------------------------
> >  drivers/usb/typec/ucsi/ucsi.h        |  41 ----
> >  4 files changed, 43 insertions(+), 384 deletions(-)
> > 
> > diff --git a/drivers/usb/typec/ucsi/displayport.c
> > b/drivers/usb/typec/ucsi/displayport.c
> > index d99700cb4dca..47424935bc81 100644
> > --- a/drivers/usb/typec/ucsi/displayport.c
> > +++ b/drivers/usb/typec/ucsi/displayport.c
> > @@ -48,6 +48,7 @@ struct ucsi_dp {
> >  static int ucsi_displayport_enter(struct typec_altmode *alt)  {
> >     struct ucsi_dp *dp = typec_altmode_get_drvdata(alt);
> > +   struct ucsi *ucsi = dp->con->ucsi;
> >     struct ucsi_control ctrl;
> >     u8 cur = 0;
> >     int ret;
> Need to initialize "ret" otherwise we will return uninitialized value if first
> "if" condition in this function is true.

"ret" does get a value in the first "if" condition. See below.

> > @@ -59,25 +60,21 @@ static int ucsi_displayport_enter(struct typec_altmode
> > *alt)
> > 
> >             dev_warn(&p->dev,
> >                      "firmware doesn't support alternate mode
> > overriding\n");
> > -           mutex_unlock(&dp->con->lock);
> > -           return -EOPNOTSUPP;
> > +           ret = -EOPNOTSUPP;
                ^^^^^^^^^^^^^^^^^^
Note.

> > +           goto err_unlock;
> >     }

thanks,

-- 
heikki

Reply via email to