Re: [PATCH v2] can: gs_usb.c: add usb endpoint address detection at driver probe step

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon. 23 Sep. 2024 at 13:00, Vincent MAILHOL
<mailhol.vincent@xxxxxxxxxx> wrote:

(...)

> > +       if (rc) {
> > +               dev_err(&intf->dev, "Required endpoints not found\n");
> > +               return rc;
> > +       }
> >
> >         /* send host config */
> >         rc = usb_control_msg_send(udev, 0,
> > @@ -1466,6 +1478,10 @@ static int gs_usb_probe(struct usb_interface *intf,
> >         usb_set_intfdata(intf, parent);
> >         parent->udev = udev;
>
> Maybe have the usb_find_common_endpoints() next to this? There is no
> need to do the endpoint search earlier, so better to group this which
> are related together.

Actually, if you move the usb_find_common_endpoints() down as I
suggested, you would have to add some clean-ups (e.g. kfree(parent))
if the function fails. Probably not worth the effort. Please ignore
this last comment.

> > +       /* store the detected endpoints */
> > +       parent->ep_in = ep_in->bEndpointAddress;
> > +       parent->ep_out = ep_out->bEndpointAddress;
> > +
> >         for (i = 0; i < icount; i++) {
> >                 unsigned int hf_size_rx = 0;




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux