Re: [PATCH 2/7] usb: dwc3: pci: Set an easily recognizable device name

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

 



On Fri, Feb 16, 2018 at 11:55 PM, Thinh Nguyen
<Thinh.Nguyen@xxxxxxxxxxxx> wrote:
> Set the device name for PCI glue layer to "dwc3-pci.BB:SS.FF" where BB
> is PCI bus number, SS is PCI slot, and FF is PCI function number.

Isn't pci_name(pci) actually returns you a BDF notation of the device?

> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -229,6 +229,9 @@ static int dwc3_pci_probe(struct pci_dev *pci,
>         dwc->dwc3->dev.parent = dev;
>         ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev));
>
> +       dev_set_name(dev, "dwc3-pci.%02x:%02x.%d", pci->bus->number,
> +                    PCI_SLOT(pci->devfn), PCI_FUNC(pci->devfn));
> +

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux