Skip to contentSkip to conversation

PCI: Rename host functions for consistency

PATCH New Bjorn Helgaas 4 participants 7 messages Nov 13, 2017 – Nov 14, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover PCI: Rename host functions for consistency

All native host bridge driver probe functions are called *_pci_probe() or *_pcie_probe() *except* X-Gene's. All "is the link up?" functions are called *_pcie_link_up() *except* Altera's and Xilinx's. Rename them to be consistent.

I plan to include these for v4.15 unless there are objections.

---

Bjorn Helgaas (3):
PCI: xgene: Rename xgene_pcie_probe_bridge() to xgene_pcie_probe()
PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()
PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up()

 drivers/pci/host/pci-xgene.c   |    4 ++--
 drivers/pci/host/pcie-altera.c |    8 ++++----
 drivers/pci/host/pcie-xilinx.c |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
#1 lore raw

PATCH 1/3 PCI: xgene: Rename xgene_pcie_probe_bridge() to xgene_pcie_probe()

From: Bjorn Helgaas <[email protected]>

Rename xgene_pcie_probe_bridge() to xgene_pcie_probe() to follow the convention of other drivers. No functional change intended.

---
 drivers/pci/host/pci-xgene.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/host/pci-xgene.c +2 -2
index 087645116ecb..9f53612f6594 100644
@@ -628,7 +628,7 @@ static struct pci_ops xgene_pcie_ops = {
 	.write = pci_generic_config_write32,
 };
 
-static int xgene_pcie_probe_bridge(struct platform_device *pdev)
+static int xgene_pcie_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *dn = dev->of_node;
@@ -709,7 +709,7 @@ static struct platform_driver xgene_pcie_driver = {
 		.of_match_table = of_match_ptr(xgene_pcie_match_table),
 		.suppress_bind_attrs = true,
 	},
-	.probe = xgene_pcie_probe_bridge,
+	.probe = xgene_pcie_probe,
 };
 builtin_platform_driver(xgene_pcie_driver);
 #endif
#2 lore raw

PATCH 2/3 PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()

In reply to Bjorn Helgaas

From: Bjorn Helgaas <[email protected]>

Rename altera_pcie_link_is_up() to altera_pcie_link_up() to follow the convention of other drivers. No functional change intended.

---
 drivers/pci/host/pcie-altera.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pci/host/pcie-altera.c +4 -4
index b468b8cccf8d..5cc4f594d79a 100644
@@ -105,7 +105,7 @@ static inline u32 cra_readl(struct altera_pcie *pcie, const u32 reg)
 	return readl_relaxed(pcie->cra_base + reg);
 }
 
-static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+static bool altera_pcie_link_up(struct altera_pcie *pcie)
 {
 	return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
 }
@@ -142,7 +142,7 @@ static bool altera_pcie_valid_device(struct altera_pcie *pcie,
 {
 	/* If there is no link, then there is no device */
 	if (bus->number != pcie->root_bus_nr) {
-		if (!altera_pcie_link_is_up(pcie))
+		if (!altera_pcie_link_up(pcie))
 			return false;
 	}
 
@@ -412,7 +412,7 @@ static void altera_wait_link_retrain(struct altera_pcie *pcie)
 	/* Wait for link is up */
 	start_jiffies = jiffies;
 	for (;;) {
-		if (altera_pcie_link_is_up(pcie))
+		if (altera_pcie_link_up(pcie))
 			break;
 
 		if (time_after(jiffies, start_jiffies + LINK_UP_TIMEOUT)) {
@@ -427,7 +427,7 @@ static void altera_pcie_retrain(struct altera_pcie *pcie)
 {
 	u16 linkcap, linkstat, linkctl;
 
-	if (!altera_pcie_link_is_up(pcie))
+	if (!altera_pcie_link_up(pcie))
 		return;
 
 	/*
#3 lore raw

PATCH 2/3 PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()

Quoted 57 lines · Bjorn Helgaas

From: Bjorn Helgaas <[email protected]>

Rename altera_pcie_link_is_up() to altera_pcie_link_up() to follow the
convention of other drivers.??No functional change intended.

---
?drivers/pci/host/pcie-altera.c |????8 ++++----
?1 file changed, 4 insertions(+), 4 deletions(-)

drivers/pci/host/pcie- renamed from drivers/pci/host/pcie-altera.c +0 -0

altera.c
index b468b8cccf8d..5cc4f594d79a 100644

drivers/pci/host/pcie-altera.c +1 -1
@@ -105,7 +105,7 @@ static inline u32 cra_readl(struct altera_pcie
 *pcie, const u32 reg)
 ????????return readl_relaxed(pcie->cra_base + reg);
 ?}
 
-static bool altera_pcie_link_is_up(struct altera_pcie *pcie)
+static bool altera_pcie_link_up(struct altera_pcie *pcie)
 ?{

????????return !!((cra_readl(pcie, RP_LTSSM) & RP_LTSSM_MASK) == LTSSM_L0);
?}

drivers/pci/host/pcie-altera.c +0 -0
@@ -142,7 +142,7 @@ static bool altera_pcie_valid_device(struct
 altera_pcie *pcie,
 ?{

????????/* If there is no link, then there is no device */ ????????if (bus->number != pcie->root_bus_nr) { -???????????????if (!altera_pcie_link_is_up(pcie)) +???????????????if (!altera_pcie_link_up(pcie)) ????????????????????????return false;
????????}

drivers/pci/host/pcie-altera.c +0 -0
@@ -412,7 +412,7 @@ static void altera_wait_link_retrain(struct
 altera_pcie *pcie)

????????/* Wait for link is up */
????????start_jiffies = jiffies;
????????for (;;) {
-???????????????if (altera_pcie_link_is_up(pcie))
+???????????????if (altera_pcie_link_up(pcie))
????????????????????????break;

????????????????if (time_after(jiffies, start_jiffies + LINK_UP_TIMEOUT)) {

drivers/pci/host/pcie-altera.c +1 -1
@@ -427,7 +427,7 @@ static void altera_pcie_retrain(struct
 altera_pcie *pcie)
 ?{
 ????????u16 linkcap, linkstat, linkctl;
 
-???????if (!altera_pcie_link_is_up(pcie))
+???????if (!altera_pcie_link_up(pcie))
 ????????????????return;
 
Quoted 2 lines

????????/*

#4 lore raw

PATCH 3/3 PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up()

In reply to Bjorn Helgaas

From: Bjorn Helgaas <[email protected]>

Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up() to follow the convention of other drivers. No functional change intended.

---
 drivers/pci/host/pcie-xilinx.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/host/pcie-xilinx.c +3 -3
index 94e13cb8608f..7b5325990f5e 100644
@@ -129,7 +129,7 @@ static inline void pcie_write(struct xilinx_pcie_port *port, u32 val, u32 reg)
 	writel(val, port->reg_base + reg);
 }
 
-static inline bool xilinx_pcie_link_is_up(struct xilinx_pcie_port *port)
+static inline bool xilinx_pcie_link_up(struct xilinx_pcie_port *port)
 {
 	return (pcie_read(port, XILINX_PCIE_REG_PSCR) &
 		XILINX_PCIE_REG_PSCR_LNKUP) ? 1 : 0;
@@ -165,7 +165,7 @@ static bool xilinx_pcie_valid_device(struct pci_bus *bus, unsigned int devfn)
 
 	/* Check if link is up when trying to access downstream ports */
 	if (bus->number != port->root_busno)
-		if (!xilinx_pcie_link_is_up(port))
+		if (!xilinx_pcie_link_up(port))
 			return false;
 
 	/* Only one device down on each root port */
@@ -541,7 +541,7 @@ static void xilinx_pcie_init_port(struct xilinx_pcie_port *port)
 {
 	struct device *dev = port->dev;
 
-	if (xilinx_pcie_link_is_up(port))
+	if (xilinx_pcie_link_up(port))
 		dev_info(dev, "PCIe Link is UP\n");
 	else
 		dev_info(dev, "PCIe Link is DOWN\n");
#5 lore raw

PATCH 3/3 PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up()

Quoted 34 lines · Bjorn Helgaas

From: Bjorn Helgaas <[email protected]>

Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up() to follow the convention of other drivers. No functional change intended.

---
 drivers/pci/host/pcie-xilinx.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/host/pcie-xilinx.c +2 -2
index 94e13cb8608f..7b5325990f5e 100644
@@ -129,7 +129,7 @@ static inline void pcie_write(struct xilinx_pcie_port *port, u32 val, u32 reg)
 	writel(val, port->reg_base + reg);
 }
 
-static inline bool xilinx_pcie_link_is_up(struct xilinx_pcie_port *port)
+static inline bool xilinx_pcie_link_up(struct xilinx_pcie_port *port)
 {
 	return (pcie_read(port, XILINX_PCIE_REG_PSCR) &
 		XILINX_PCIE_REG_PSCR_LNKUP) ? 1 : 0;
@@ -165,7 +165,7 @@ static bool xilinx_pcie_valid_device(struct pci_bus *bus, unsigned int devfn)
 
 	/* Check if link is up when trying to access downstream ports */
 	if (bus->number != port->root_busno)
-		if (!xilinx_pcie_link_is_up(port))
+		if (!xilinx_pcie_link_up(port))
 			return false;
 
 	/* Only one device down on each root port */

drivers/pci/host/pcie-xilinx.c static void xilinx_pcie_init_port(struct xilinx_pcie_port *port) · line 547

Quoted 8 lines
drivers/pci/host/pcie-xilinx.c +1 -1
@@ -541,7 +541,7 @@ static void xilinx_pcie_init_port(struct xilinx_pcie_port *port)
 {
 	struct device *dev = port->dev;
 
-	if (xilinx_pcie_link_is_up(port))
+	if (xilinx_pcie_link_up(port))
 		dev_info(dev, "PCIe Link is UP\n");
 	else
 		dev_info(dev, "PCIe Link is DOWN\n");

Thanks,
Michal

#6 lore raw

cover PCI: Rename host functions for consistency

In reply to Bjorn Helgaas
Quoted 15 lines · Bjorn Helgaas

All native host bridge driver probe functions are called *_pci_probe() or *_pcie_probe() *except* X-Gene's. All "is the link up?" functions are called *_pcie_link_up() *except* Altera's and Xilinx's. Rename them to be consistent.

I plan to include these for v4.15 unless there are objections.

---

Bjorn Helgaas (3):
PCI: xgene: Rename xgene_pcie_probe_bridge() to xgene_pcie_probe()
PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()
PCI: xilinx: Rename xilinx_pcie_link_is_up() to xilinx_pcie_link_up()

Quoted 4 lines
 drivers/pci/host/pci-xgene.c   |    4 ++--
 drivers/pci/host/pcie-altera.c |    8 ++++----
 drivers/pci/host/pcie-xilinx.c |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

On the series: