@@ -93,8 +93,8 @@ struct mt7621_pcie_port {
93
93
* reset lines are inverted.
94
94
*/
95
95
struct mt7621_pcie {
96
- void __iomem * base ;
97
96
struct device * dev ;
97
+ void __iomem * base ;
98
98
struct list_head ports ;
99
99
bool resets_inverted ;
100
100
};
@@ -129,7 +129,7 @@ static inline void pcie_port_write(struct mt7621_pcie_port *port,
129
129
writel_relaxed (val , port -> base + reg );
130
130
}
131
131
132
- static inline u32 mt7621_pci_get_cfgaddr (unsigned int bus , unsigned int slot ,
132
+ static inline u32 mt7621_pcie_get_cfgaddr (unsigned int bus , unsigned int slot ,
133
133
unsigned int func , unsigned int where )
134
134
{
135
135
return (((where & 0xf00 ) >> 8 ) << 24 ) | (bus << 16 ) | (slot << 11 ) |
@@ -140,23 +140,23 @@ static void __iomem *mt7621_pcie_map_bus(struct pci_bus *bus,
140
140
unsigned int devfn , int where )
141
141
{
142
142
struct mt7621_pcie * pcie = bus -> sysdata ;
143
- u32 address = mt7621_pci_get_cfgaddr (bus -> number , PCI_SLOT (devfn ),
143
+ u32 address = mt7621_pcie_get_cfgaddr (bus -> number , PCI_SLOT (devfn ),
144
144
PCI_FUNC (devfn ), where );
145
145
146
146
writel_relaxed (address , pcie -> base + RALINK_PCI_CONFIG_ADDR );
147
147
148
148
return pcie -> base + RALINK_PCI_CONFIG_DATA + (where & 3 );
149
149
}
150
150
151
- struct pci_ops mt7621_pci_ops = {
151
+ struct pci_ops mt7621_pcie_ops = {
152
152
.map_bus = mt7621_pcie_map_bus ,
153
153
.read = pci_generic_config_read ,
154
154
.write = pci_generic_config_write ,
155
155
};
156
156
157
157
static u32 read_config (struct mt7621_pcie * pcie , unsigned int dev , u32 reg )
158
158
{
159
- u32 address = mt7621_pci_get_cfgaddr (0 , dev , 0 , reg );
159
+ u32 address = mt7621_pcie_get_cfgaddr (0 , dev , 0 , reg );
160
160
161
161
pcie_write (pcie , address , RALINK_PCI_CONFIG_ADDR );
162
162
return pcie_read (pcie , RALINK_PCI_CONFIG_DATA );
@@ -165,7 +165,7 @@ static u32 read_config(struct mt7621_pcie *pcie, unsigned int dev, u32 reg)
165
165
static void write_config (struct mt7621_pcie * pcie , unsigned int dev ,
166
166
u32 reg , u32 val )
167
167
{
168
- u32 address = mt7621_pci_get_cfgaddr (0 , dev , 0 , reg );
168
+ u32 address = mt7621_pcie_get_cfgaddr (0 , dev , 0 , reg );
169
169
170
170
pcie_write (pcie , address , RALINK_PCI_CONFIG_ADDR );
171
171
pcie_write (pcie , val , RALINK_PCI_CONFIG_DATA );
@@ -505,16 +505,16 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host)
505
505
{
506
506
struct mt7621_pcie * pcie = pci_host_bridge_priv (host );
507
507
508
- host -> ops = & mt7621_pci_ops ;
508
+ host -> ops = & mt7621_pcie_ops ;
509
509
host -> sysdata = pcie ;
510
510
return pci_host_probe (host );
511
511
}
512
512
513
- static const struct soc_device_attribute mt7621_pci_quirks_match [] = {
513
+ static const struct soc_device_attribute mt7621_pcie_quirks_match [] = {
514
514
{ .soc_id = "mt7621" , .revision = "E2" }
515
515
};
516
516
517
- static int mt7621_pci_probe (struct platform_device * pdev )
517
+ static int mt7621_pcie_probe (struct platform_device * pdev )
518
518
{
519
519
struct device * dev = & pdev -> dev ;
520
520
const struct soc_device_attribute * attr ;
@@ -535,7 +535,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
535
535
platform_set_drvdata (pdev , pcie );
536
536
INIT_LIST_HEAD (& pcie -> ports );
537
537
538
- attr = soc_device_match (mt7621_pci_quirks_match );
538
+ attr = soc_device_match (mt7621_pcie_quirks_match );
539
539
if (attr )
540
540
pcie -> resets_inverted = true;
541
541
@@ -572,7 +572,7 @@ static int mt7621_pci_probe(struct platform_device *pdev)
572
572
return err ;
573
573
}
574
574
575
- static int mt7621_pci_remove (struct platform_device * pdev )
575
+ static int mt7621_pcie_remove (struct platform_device * pdev )
576
576
{
577
577
struct mt7621_pcie * pcie = platform_get_drvdata (pdev );
578
578
struct mt7621_pcie_port * port ;
@@ -583,18 +583,18 @@ static int mt7621_pci_remove(struct platform_device *pdev)
583
583
return 0 ;
584
584
}
585
585
586
- static const struct of_device_id mt7621_pci_ids [] = {
586
+ static const struct of_device_id mt7621_pcie_ids [] = {
587
587
{ .compatible = "mediatek,mt7621-pci" },
588
588
{},
589
589
};
590
- MODULE_DEVICE_TABLE (of , mt7621_pci_ids );
590
+ MODULE_DEVICE_TABLE (of , mt7621_pcie_ids );
591
591
592
- static struct platform_driver mt7621_pci_driver = {
593
- .probe = mt7621_pci_probe ,
594
- .remove = mt7621_pci_remove ,
592
+ static struct platform_driver mt7621_pcie_driver = {
593
+ .probe = mt7621_pcie_probe ,
594
+ .remove = mt7621_pcie_remove ,
595
595
.driver = {
596
596
.name = "mt7621-pci" ,
597
- .of_match_table = of_match_ptr (mt7621_pci_ids ),
597
+ .of_match_table = of_match_ptr (mt7621_pcie_ids ),
598
598
},
599
599
};
600
- builtin_platform_driver (mt7621_pci_driver );
600
+ builtin_platform_driver (mt7621_pcie_driver );
0 commit comments