diff mbox series

[v3,7/9] PCI: Add PCIe suffix when display PCIe slot bus speed

Message ID 1581593793-23589-8-git-send-email-yangyicong@hisilicon.com
State New
Headers show
Series Improve link speed presentation process | expand

Commit Message

Yicong Yang Feb. 13, 2020, 11:36 a.m. UTC
"PCIe" suffix of PCIe speed strings in pci_bus_speed_strings[]
is removed in previous 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(-)

--
2.8.1
diff mbox series

Patch

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)