linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: block: skd: remove skd_pci_info()
@ 2020-12-11 16:41 Puranjay Mohan
  2020-12-11 21:50 ` Chaitanya Kulkarni
  2020-12-14  6:02 ` Damien Le Moal
  0 siblings, 2 replies; 5+ messages in thread
From: Puranjay Mohan @ 2020-12-11 16:41 UTC (permalink / raw)
  To: bjorn, linux-pci, Damien.LeMoal, axboe, linux-block, linux-kernel
  Cc: Puranjay Mohan

PCI core calls __pcie_print_link_status() for every device, it prints
both the link width and the link speed. skd_pci_info() does the same
thing again, hence it can be removed.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
---
 drivers/block/skd_main.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index a962b4551bed..da7aac5335d9 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -3134,40 +3134,11 @@ static const struct pci_device_id skd_pci_tbl[] = {
 
 MODULE_DEVICE_TABLE(pci, skd_pci_tbl);
 
-static char *skd_pci_info(struct skd_device *skdev, char *str)
-{
-	int pcie_reg;
-
-	strcpy(str, "PCIe (");
-	pcie_reg = pci_find_capability(skdev->pdev, PCI_CAP_ID_EXP);
-
-	if (pcie_reg) {
-
-		char lwstr[6];
-		uint16_t pcie_lstat, lspeed, lwidth;
-
-		pcie_reg += 0x12;
-		pci_read_config_word(skdev->pdev, pcie_reg, &pcie_lstat);
-		lspeed = pcie_lstat & (0xF);
-		lwidth = (pcie_lstat & 0x3F0) >> 4;
-
-		if (lspeed == 1)
-			strcat(str, "2.5GT/s ");
-		else if (lspeed == 2)
-			strcat(str, "5.0GT/s ");
-		else
-			strcat(str, "<unknown> ");
-		snprintf(lwstr, sizeof(lwstr), "%dX)", lwidth);
-		strcat(str, lwstr);
-	}
-	return str;
-}
 
 static int skd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	int i;
 	int rc = 0;
-	char pci_str[32];
 	struct skd_device *skdev;
 
 	dev_dbg(&pdev->dev, "vendor=%04X device=%04x\n", pdev->vendor,
@@ -3201,8 +3172,6 @@ static int skd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_out_regions;
 	}
 
-	skd_pci_info(skdev, pci_str);
-	dev_info(&pdev->dev, "%s 64bit\n", pci_str);
 
 	pci_set_master(pdev);
 	rc = pci_enable_pcie_error_reporting(pdev);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-14  6:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-11 16:41 [PATCH] drivers: block: skd: remove skd_pci_info() Puranjay Mohan
2020-12-11 21:50 ` Chaitanya Kulkarni
2020-12-11 22:41   ` Bjorn Helgaas
2020-12-12  1:59     ` Chaitanya Kulkarni
2020-12-14  6:02 ` Damien Le Moal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).