diff mbox series

[v4,08/10] PCI: Add PCIe suffix when display PCIe slot bus speed

Message ID 1581937984-40353-9-git-send-email-yangyicong@hisilicon.com
State New
Headers show
Series Improve link speed presentation process | expand

Commit Message

Yicong Yang Feb. 17, 2020, 11:13 a.m. UTC
"PCIe" suffix of PCIe speed strings in pci_bus_speed_strings[]
is removed in previos patch. Add "PCIe" suffix when display PCIe
slot bus speed to userspace like before.

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
 drivers/pci/slot.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 1c7e83f2..871d598 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -51,7 +51,10 @@  static ssize_t address_read_file(struct pci_slot *slot, char *buf)
 static ssize_t bus_speed_read(enum pci_bus_speed speed, char *buf)
-	return sprintf(buf, "%s\n", PCI_SPEED2STR(speed));
+	if (speed <= PCI_SPEED_133MHz_PCIX_533)
+		return sprintf(buf, "%s\n", PCI_SPEED2STR(speed));
+	return sprintf(buf, "%s PCIe\n", PCI_SPEED2STR(speed));
 static ssize_t max_speed_read_file(struct pci_slot *slot, char *buf)