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

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Date: 2018-02-16 21:55:52
Subsystem: designware usb3 drd ip driver, the rest, usb subsystem · Maintainers: Thinh Nguyen, Linus Torvalds, Greg Kroah-Hartman

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.

Signed-off-by: Thinh Nguyen <redacted>
---
 drivers/usb/dwc3/dwc3-pci.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index c961a94d136b..11b1eb1e2cda 100644
--- 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));
+
 	ret = dwc3_pci_quirks(dwc);
 	if (ret)
 		goto err;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help