Re: [cip-dev] [PATCH 4.19.y-cip 15/23] usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller

Marian-Cristian Rotariu
2020-02-20T16:28:16Z

Hi!

> -----Original Message-----
> From: Pavel Machek <pavel@denx.de>
> Sent: 20 February 2020 15:47
> To: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com>
> Cc: Pavel Machek <pavel@denx.de>; cip-dev@lists.cip-project.org
> Subject: Re: [cip-dev] [PATCH 4.19.y-cip 15/23] usb: typec: driver for TI
> HD3SS3220 USB Type-C DRP port controller
>
> Hi!
>
> > > > +static enum usb_role hd3ss3220_get_attached_state(struct
> > > > +hd3ss3220
> > > > +*hd3ss3220) {
> > > > + unsigned int reg_val;
> > > > + enum usb_role attached_state;
> > > > + int ret;
> > > > +
> > > > + ret = regmap_read(hd3ss3220->regmap,
> > > HD3SS3220_REG_CN_STAT_CTRL,
> > > > + &reg_val);
> > > > + if (ret < 0)
> > > > + return ret;
> > >
> > > This function claims to return "enum usb_role", but here it returns
> > > errno from regmap_read.
>

Yes, this a mistake. The error should be properly propagated to the callers
(that is hd3ss3220_probe)

Also in the mainline. I will fix it in v2 and in mainline.

Thank you for the good catch,
Marian
_______________________________________________
cip-dev mailing list
cip-dev@lists.cip-project.org