[U-Boot] [PATCH 6/8] usb: add usb_submit_int_msg_nonblock

Michal Suchánek msuchanek at suse.de
Tue Jul 2 14:58:38 UTC 2019


On Tue, 2 Jul 2019 22:29:42 +0800
Bin Meng <bmeng.cn at gmail.com> wrote:

> Hi Michal,
> 
> On Tue, Jul 2, 2019 at 10:25 PM Michal Suchánek <msuchanek at suse.de> wrote:
> >
> > On Tue, 2 Jul 2019 22:16:02 +0800
> > Bin Meng <bmeng.cn at gmail.com> wrote:
> >  
> > > Hi Michal,
> > >
> > > On Tue, Jul 2, 2019 at 10:14 PM Michal Suchánek <msuchanek at suse.de> wrote:  
> > > >
> > > > On Tue, 2 Jul 2019 13:59:49 +0200
> > > > Marek Vasut <marex at denx.de> wrote:
> > > >  
> > > > > On 7/1/19 5:56 PM, Michal Suchanek wrote:  
> > > > > > Signed-off-by: Michal Suchanek <msuchanek at suse.de>
> > > > > > ---
> > > > > >  common/usb.c  | 9 +++++++++
> > > > > >  include/usb.h | 2 ++
> > > > > >  2 files changed, 11 insertions(+)
> > > > > >
> > > > > > diff --git a/common/usb.c b/common/usb.c
> > > > > > index 3ae71c98aaf4..d8302d39a91a 100644
> > > > > > --- a/common/usb.c
> > > > > > +++ b/common/usb.c
> > > > > > @@ -200,6 +200,15 @@ int usb_submit_int_msg(struct usb_device *dev, unsigned long pipe,
> > > > > >     return submit_int_msg(dev, pipe, buffer, transfer_len, interval, false);
> > > > > >  }
> > > > > >
> > > > > > +/*
> > > > > > + * submits an Interrupt Message without retry
> > > > > > + */
> > > > > > +int usb_submit_int_msg_nonblock(struct usb_device *dev, unsigned long pipe,
> > > > > > +                   void *buffer, int transfer_len, int interval)
> > > > > > +{
> > > > > > +   return submit_int_msg(dev, pipe, buffer, transfer_len, interval, true);
> > > > > > +}  
> > > > >
> > > > > Is this wrapper really necessary ?
> > > > >  
> > > >
> > > > Avoids changing other users of the code. Not that there are that many,
> > > > anyway.  
> > >
> > > Then I wonder why not change your codes to call submit_int_msg() instead?
> > >  
> > Why do we have usb_submit_int_msg in the first place?  
> 
> I am happy to remove that. A patch is welcome. :)
> 

So the answer is we have wrappers for USB messages, and while
submit_int_msg is trivial others are not. To keep reasonable interface
all messages should be wrapped.

Thanks

Michal


More information about the U-Boot mailing list