Feed the mess through indent.
[linux-2.6/linux-mips.git] / arch / mips / pci / common.c
blob1692c007ac1fd5a8bcf53d0ac9f81a63f8480a19
1 void __init pcibios_fixup_bus(struct pci_bus *b)
3 Dprintk("pcibios_fixup_bus()\n");
6 static int pcibios_enable_resources(struct pci_dev *dev, int mask)
8 u16 cmd, old_cmd;
9 int idx;
10 struct resource *r;
12 pci_read_config_word(dev, PCI_COMMAND, &cmd);
13 old_cmd = cmd;
14 for (idx = 0; idx < 6; idx++) {
15 /* Only set up the requested stuff */
16 if (!(mask & (1 << idx)))
17 continue;
19 r = &dev->resource[idx];
20 if (!r->start && r->end) {
21 printk(KERN_ERR
22 "PCI: Device %s not available because of resource collisions\n",
23 dev->slot_name);
24 return -EINVAL;
26 if (r->flags & IORESOURCE_IO)
27 cmd |= PCI_COMMAND_IO;
28 if (r->flags & IORESOURCE_MEM)
29 cmd |= PCI_COMMAND_MEMORY;
31 if (dev->resource[PCI_ROM_RESOURCE].start)
32 cmd |= PCI_COMMAND_MEMORY;
33 if (cmd != old_cmd) {
34 printk("PCI: Enabling device %s (%04x -> %04x)\n",
35 dev->slot_name, old_cmd, cmd);
36 pci_write_config_word(dev, PCI_COMMAND, cmd);
38 return 0;
41 int pcibios_enable_device(struct pci_dev *dev, int mask)
43 int err;
45 if ((err = pcibios_enable_resources(dev, mask)) < 0)
46 return err;
48 return 0;
51 void __init pcibios_align_resource(void *data, struct resource *res,
52 unsigned long size, unsigned long align)
54 panic("Uhhoh called pcibios_align_resource");
57 unsigned __init int pcibios_assign_all_busses(void)
59 return 1;
62 char *pcibios_setup(char *str)
64 return str;
67 struct pci_fixup pcibios_fixups[] = {
68 {0}