On Mon, Sep 03, 2018 at 09:01:47AM +0300, Andy Shevchenko wrote: > On Fri, Aug 31, 2018 at 5:21 PM Heikki Krogerus > <heikki.krogerus@xxxxxxxxxxxxxxx> wrote: > > > > Only create thre Intel role mux device if the platform has > > USB peripheral controller PCI device. > > > > While here, enable the role mux on Apollo Lake platforms. > > > +static int xhci_pci_board_has_udc(void) > > +{ > > + struct pci_dev *udc = pci_get_class(PCI_CLASS_SERIAL_USB_DEVICE, NULL); > > + > > + if (udc) { > > + pci_dev_put(udc); > > + return true; > > + } > > + return false; > > +} > > Looks like a code duplication with patch 3. Does it make sense to have > this in some header (usb.h?)? I don't know. The check is very PCI specific. I'm not sure ush.h would be appropriate place for it. I don't know where should it go? Right now the check is only needed on Intel CHT (in both patches), so I figured that it's better wait for an other user before introducing a helper for it. Would that make sense? Thanks, -- heikki