aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-10-05 13:18:07 -0400
committerRalf Baechle <ralf@linux-mips.org>2016-10-06 11:56:13 -0400
commit23dac14d058fcd7cb2b4e6389139ca065855afe7 (patch)
tree24c6ac358767d802528bc7de3535cdd4e2964be6
parentd05c513069f15be5de766026a4192998688ffff1 (diff)
MIPS: PCI: Use struct list_head lists
Rather than open-coding a linked list implementation, make use of the one in linux/list.h. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14340/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/pci.h3
-rw-r--r--arch/mips/pci/pci.c9
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 9b63cd41213d..547e113ac0fe 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -17,6 +17,7 @@
17 */ 17 */
18 18
19#include <linux/ioport.h> 19#include <linux/ioport.h>
20#include <linux/list.h>
20#include <linux/of.h> 21#include <linux/of.h>
21 22
22/* 23/*
@@ -25,7 +26,7 @@
25 * single controller supporting multiple channels. 26 * single controller supporting multiple channels.
26 */ 27 */
27struct pci_controller { 28struct pci_controller {
28 struct pci_controller *next; 29 struct list_head list;
29 struct pci_bus *bus; 30 struct pci_bus *bus;
30 struct device_node *of_node; 31 struct device_node *of_node;
31 32
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index b4c02f29663e..644ae9696edd 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -28,8 +28,7 @@
28/* 28/*
29 * The PCI controller list. 29 * The PCI controller list.
30 */ 30 */
31 31static LIST_HEAD(controllers);
32static struct pci_controller *hose_head, **hose_tail = &hose_head;
33 32
34unsigned long PCIBIOS_MIN_IO; 33unsigned long PCIBIOS_MIN_IO;
35unsigned long PCIBIOS_MIN_MEM; 34unsigned long PCIBIOS_MIN_MEM;
@@ -193,8 +192,8 @@ void register_pci_controller(struct pci_controller *hose)
193 goto out; 192 goto out;
194 } 193 }
195 194
196 *hose_tail = hose; 195 INIT_LIST_HEAD(&hose->list);
197 hose_tail = &hose->next; 196 list_add(&hose->list, &controllers);
198 197
199 /* 198 /*
200 * Do not panic here but later - this might happen before console init. 199 * Do not panic here but later - this might happen before console init.
@@ -248,7 +247,7 @@ static int __init pcibios_init(void)
248 pcibios_set_cache_line_size(); 247 pcibios_set_cache_line_size();
249 248
250 /* Scan all of the recorded PCI controllers. */ 249 /* Scan all of the recorded PCI controllers. */
251 for (hose = hose_head; hose; hose = hose->next) 250 list_for_each_entry(hose, &controllers, list)
252 pcibios_scanbus(hose); 251 pcibios_scanbus(hose);
253 252
254 pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq); 253 pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);