ramips: 6.1: copy config and patches
[openwrt/staging/jow.git] / target / linux / ramips / patches-6.1 / 101-v5.17-PCI-mt7621-Rename-mt7621_pci_-to-mt7621_pcie_.patch
1 From: Bjorn Helgaas <bhelgaas@google.com>
2 Date: Wed, 22 Dec 2021 19:10:48 -0600
3 Subject: [PATCH] PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_
4
5 Rename mt7621_pci_* structs and functions to mt7621_pcie_* for consistency
6 with the rest of the file.
7
8 Link: https://lore.kernel.org/r/20211223011054.1227810-18-helgaas@kernel.org
9 Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
10 Reviewed-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
11 Cc: Matthias Brugger <matthias.bgg@gmail.com>
12 ---
13
14 --- a/drivers/pci/controller/pcie-mt7621.c
15 +++ b/drivers/pci/controller/pcie-mt7621.c
16 @@ -93,8 +93,8 @@ struct mt7621_pcie_port {
17 * reset lines are inverted.
18 */
19 struct mt7621_pcie {
20 - void __iomem *base;
21 struct device *dev;
22 + void __iomem *base;
23 struct list_head ports;
24 bool resets_inverted;
25 };
26 @@ -129,7 +129,7 @@ static inline void pcie_port_write(struc
27 writel_relaxed(val, port->base + reg);
28 }
29
30 -static inline u32 mt7621_pci_get_cfgaddr(unsigned int bus, unsigned int slot,
31 +static inline u32 mt7621_pcie_get_cfgaddr(unsigned int bus, unsigned int slot,
32 unsigned int func, unsigned int where)
33 {
34 return (((where & 0xf00) >> 8) << 24) | (bus << 16) | (slot << 11) |
35 @@ -140,7 +140,7 @@ static void __iomem *mt7621_pcie_map_bus
36 unsigned int devfn, int where)
37 {
38 struct mt7621_pcie *pcie = bus->sysdata;
39 - u32 address = mt7621_pci_get_cfgaddr(bus->number, PCI_SLOT(devfn),
40 + u32 address = mt7621_pcie_get_cfgaddr(bus->number, PCI_SLOT(devfn),
41 PCI_FUNC(devfn), where);
42
43 writel_relaxed(address, pcie->base + RALINK_PCI_CONFIG_ADDR);
44 @@ -148,7 +148,7 @@ static void __iomem *mt7621_pcie_map_bus
45 return pcie->base + RALINK_PCI_CONFIG_DATA + (where & 3);
46 }
47
48 -struct pci_ops mt7621_pci_ops = {
49 +struct pci_ops mt7621_pcie_ops = {
50 .map_bus = mt7621_pcie_map_bus,
51 .read = pci_generic_config_read,
52 .write = pci_generic_config_write,
53 @@ -156,7 +156,7 @@ struct pci_ops mt7621_pci_ops = {
54
55 static u32 read_config(struct mt7621_pcie *pcie, unsigned int dev, u32 reg)
56 {
57 - u32 address = mt7621_pci_get_cfgaddr(0, dev, 0, reg);
58 + u32 address = mt7621_pcie_get_cfgaddr(0, dev, 0, reg);
59
60 pcie_write(pcie, address, RALINK_PCI_CONFIG_ADDR);
61 return pcie_read(pcie, RALINK_PCI_CONFIG_DATA);
62 @@ -165,7 +165,7 @@ static u32 read_config(struct mt7621_pci
63 static void write_config(struct mt7621_pcie *pcie, unsigned int dev,
64 u32 reg, u32 val)
65 {
66 - u32 address = mt7621_pci_get_cfgaddr(0, dev, 0, reg);
67 + u32 address = mt7621_pcie_get_cfgaddr(0, dev, 0, reg);
68
69 pcie_write(pcie, address, RALINK_PCI_CONFIG_ADDR);
70 pcie_write(pcie, val, RALINK_PCI_CONFIG_DATA);
71 @@ -505,16 +505,16 @@ static int mt7621_pcie_register_host(str
72 {
73 struct mt7621_pcie *pcie = pci_host_bridge_priv(host);
74
75 - host->ops = &mt7621_pci_ops;
76 + host->ops = &mt7621_pcie_ops;
77 host->sysdata = pcie;
78 return pci_host_probe(host);
79 }
80
81 -static const struct soc_device_attribute mt7621_pci_quirks_match[] = {
82 +static const struct soc_device_attribute mt7621_pcie_quirks_match[] = {
83 { .soc_id = "mt7621", .revision = "E2" }
84 };
85
86 -static int mt7621_pci_probe(struct platform_device *pdev)
87 +static int mt7621_pcie_probe(struct platform_device *pdev)
88 {
89 struct device *dev = &pdev->dev;
90 const struct soc_device_attribute *attr;
91 @@ -535,7 +535,7 @@ static int mt7621_pci_probe(struct platf
92 platform_set_drvdata(pdev, pcie);
93 INIT_LIST_HEAD(&pcie->ports);
94
95 - attr = soc_device_match(mt7621_pci_quirks_match);
96 + attr = soc_device_match(mt7621_pcie_quirks_match);
97 if (attr)
98 pcie->resets_inverted = true;
99
100 @@ -572,7 +572,7 @@ remove_resets:
101 return err;
102 }
103
104 -static int mt7621_pci_remove(struct platform_device *pdev)
105 +static int mt7621_pcie_remove(struct platform_device *pdev)
106 {
107 struct mt7621_pcie *pcie = platform_get_drvdata(pdev);
108 struct mt7621_pcie_port *port;
109 @@ -583,18 +583,18 @@ static int mt7621_pci_remove(struct plat
110 return 0;
111 }
112
113 -static const struct of_device_id mt7621_pci_ids[] = {
114 +static const struct of_device_id mt7621_pcie_ids[] = {
115 { .compatible = "mediatek,mt7621-pci" },
116 {},
117 };
118 -MODULE_DEVICE_TABLE(of, mt7621_pci_ids);
119 +MODULE_DEVICE_TABLE(of, mt7621_pcie_ids);
120
121 -static struct platform_driver mt7621_pci_driver = {
122 - .probe = mt7621_pci_probe,
123 - .remove = mt7621_pci_remove,
124 +static struct platform_driver mt7621_pcie_driver = {
125 + .probe = mt7621_pcie_probe,
126 + .remove = mt7621_pcie_remove,
127 .driver = {
128 .name = "mt7621-pci",
129 - .of_match_table = of_match_ptr(mt7621_pci_ids),
130 + .of_match_table = of_match_ptr(mt7621_pcie_ids),
131 },
132 };
133 -builtin_platform_driver(mt7621_pci_driver);
134 +builtin_platform_driver(mt7621_pcie_driver);