Commit 017e0fad3e40ece983527ec88a92b3da8fcdecea

Authored by Kumar Gala
Committed by Paul Mackerras
1 parent 03929c76f3

[PATCH] powerpc: fixing compile issue with !CONFIG_PCI in legacy_serial.c

Only build in support for ISA and PCI cases if we have enabled CONFIG_ISA
and CONFIG_PCI.  Additionally, isa_bridge is a global so we shouldn't use
it a parameter name since it gets redefined to NULL when !CONFIG_PCI.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

Showing 1 changed file with 11 additions and 1 deletions Side-by-side Diff

arch/powerpc/kernel/legacy_serial.c
... ... @@ -134,8 +134,9 @@
134 134 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags);
135 135 }
136 136  
  137 +#ifdef CONFIG_ISA
137 138 static int __init add_legacy_isa_port(struct device_node *np,
138   - struct device_node *isa_bridge)
  139 + struct device_node *isa_brg)
139 140 {
140 141 u32 *reg;
141 142 char *typep;
142 143  
... ... @@ -167,7 +168,9 @@
167 168 return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF);
168 169  
169 170 }
  171 +#endif
170 172  
  173 +#ifdef CONFIG_PCI
171 174 static int __init add_legacy_pci_port(struct device_node *np,
172 175 struct device_node *pci_dev)
173 176 {
... ... @@ -233,6 +236,7 @@
233 236 */
234 237 return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF);
235 238 }
  239 +#endif
236 240  
237 241 /*
238 242 * This is called very early, as part of setup_system() or eventually
... ... @@ -272,6 +276,7 @@
272 276 of_node_put(soc);
273 277 }
274 278  
  279 +#ifdef CONFIG_ISA
275 280 /* First fill our array with ISA ports */
276 281 for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
277 282 struct device_node *isa = of_get_parent(np);
278 283  
... ... @@ -282,7 +287,9 @@
282 287 }
283 288 of_node_put(isa);
284 289 }
  290 +#endif
285 291  
  292 +#ifdef CONFIG_PCI
286 293 /* Next, try to locate PCI ports */
287 294 for (np = NULL; (np = of_find_all_nodes(np));) {
288 295 struct device_node *pci, *parent = of_get_parent(np);
... ... @@ -312,6 +319,7 @@
312 319 legacy_serial_console = index;
313 320 of_node_put(parent);
314 321 }
  322 +#endif
315 323  
316 324 DBG("legacy_serial_console = %d\n", legacy_serial_console);
317 325  
... ... @@ -375,6 +383,7 @@
375 383 struct device_node *np,
376 384 struct plat_serial8250_port *port)
377 385 {
  386 +#ifdef CONFIG_PCI
378 387 struct pci_controller *hose;
379 388  
380 389 DBG("fixup_port_pio(%d)\n", index);
... ... @@ -391,6 +400,7 @@
391 400 index, port->iobase, port->iobase + offset);
392 401 port->iobase += offset;
393 402 }
  403 +#endif
394 404 }
395 405  
396 406 static void __init fixup_port_mmio(int index,