Re: [PATCH v3 5/6] usb: Iterator for ports

From: Heikki Krogerus
Date: Thu Apr 01 2021 - 02:38:15 EST


On Wed, Mar 31, 2021 at 09:41:22AM -0700, Guenter Roeck wrote:
> > diff --git a/include/linux/usb.h b/include/linux/usb.h
> > index ddd2f5b2a2827..ebcd03d835d04 100644
> > --- a/include/linux/usb.h
> > +++ b/include/linux/usb.h
> > @@ -882,6 +882,15 @@ extern struct usb_host_interface *usb_find_alt_setting(
> > unsigned int iface_num,
> > unsigned int alt_num);
> >
> > +#ifdef CONFIG_USB
>
> #if IS_ENABLED(CONFIG_USB)

Thanks Guenter.

> > +int usb_for_each_port(void *data, int (*fn)(struct device *, void *));
> > +#else
> > +static inline int usb_for_each_port(void *data, int (*fn)(struct device *, void *))
> > +{
> > + return 0;
> > +}
> > +#endif
> > +
> > /* port claiming functions */
> > int usb_hub_claim_port(struct usb_device *hdev, unsigned port1,
> > struct usb_dev_state *owner);
> >

--
heikki