Merge branch 'remotes/lorenzo/pci/tegra'

- Remove unused struct tegra_pcie_bus (Krzysztof Wilczyński)

* remotes/lorenzo/pci/tegra:
  PCI: tegra: make const array err_msg static
  PCI: tegra: Use 'seq_puts' instead of 'seq_printf'
  PCI: tegra: Fix OF node reference leak
  PCI: tegra: Remove unused struct tegra_pcie_bus
This commit is contained in:
Bjorn Helgaas 2021-09-02 14:56:50 -05:00
commit db2d64f837
1 changed files with 14 additions and 16 deletions

View File

@ -372,11 +372,6 @@ struct tegra_pcie_port {
struct gpio_desc *reset_gpio;
};
struct tegra_pcie_bus {
struct list_head list;
unsigned int nr;
};
static inline void afi_writel(struct tegra_pcie *pcie, u32 value,
unsigned long offset)
{
@ -764,7 +759,7 @@ static int tegra_pcie_map_irq(const struct pci_dev *pdev, u8 slot, u8 pin)
static irqreturn_t tegra_pcie_isr(int irq, void *arg)
{
const char *err_msg[] = {
static const char * const err_msg[] = {
"Unknown",
"AXI slave error",
"AXI decode error",
@ -2191,13 +2186,15 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
rp->np = port;
rp->base = devm_pci_remap_cfg_resource(dev, &rp->regs);
if (IS_ERR(rp->base))
return PTR_ERR(rp->base);
if (IS_ERR(rp->base)) {
err = PTR_ERR(rp->base);
goto err_node_put;
}
label = devm_kasprintf(dev, GFP_KERNEL, "pex-reset-%u", index);
if (!label) {
dev_err(dev, "failed to create reset GPIO label\n");
return -ENOMEM;
err = -ENOMEM;
goto err_node_put;
}
/*
@ -2215,7 +2212,8 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
} else {
dev_err(dev, "failed to get reset GPIO: %ld\n",
PTR_ERR(rp->reset_gpio));
return PTR_ERR(rp->reset_gpio);
err = PTR_ERR(rp->reset_gpio);
goto err_node_put;
}
}
@ -2546,7 +2544,7 @@ static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
if (list_empty(&pcie->ports))
return NULL;
seq_printf(s, "Index Status\n");
seq_puts(s, "Index Status\n");
return seq_list_start(&pcie->ports, *pos);
}
@ -2583,16 +2581,16 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v)
seq_printf(s, "%2u ", port->index);
if (up)
seq_printf(s, "up");
seq_puts(s, "up");
if (active) {
if (up)
seq_printf(s, ", ");
seq_puts(s, ", ");
seq_printf(s, "active");
seq_puts(s, "active");
}
seq_printf(s, "\n");
seq_puts(s, "\n");
return 0;
}