diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 22:56:50 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 22:56:50 +0300 |
commit | db2d64f83703aca8d560abcf83166fac3d111d94 (patch) | |
tree | 35e868bfd7fb9382b5e829011b4d4a8ddd05480f /drivers/pci | |
parent | c2863b217edc1438b275bfebc4815952964a3a61 (diff) | |
parent | fd44e8efccd4de1764d195958bcac3242c921ed7 (diff) | |
download | linux-db2d64f83703aca8d560abcf83166fac3d111d94.tar.xz |
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
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/controller/pci-tegra.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index 36f898643a4c..cb0aa65d6934 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -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; } |