Commit cee71d5d authored by Eduardo Pereira Habkost's avatar Eduardo Pereira Habkost Committed by Greg Kroah-Hartman

[PATCH] Fix compilation of ip2main

The following patch fix compilation of drivers/char/ip2main.c. It was
broken by the removal of pci_present().

It just adds open and closing braces around the code that declares the
pci_dev_i variable. The rest of the patch just change the indentation.
parent c24564a2
...@@ -707,40 +707,42 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) ...@@ -707,40 +707,42 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
} }
} }
#else /* LINUX_VERSION_CODE > 2.1.99 */ #else /* LINUX_VERSION_CODE > 2.1.99 */
struct pci_dev *pci_dev_i = NULL; {
pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE, struct pci_dev *pci_dev_i = NULL;
PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i); pci_dev_i = pci_find_device(PCI_VENDOR_ID_COMPUTONE,
if (pci_dev_i != NULL) { PCI_DEVICE_ID_COMPUTONE_IP2EX, pci_dev_i);
unsigned int addr; if (pci_dev_i != NULL) {
unsigned char pci_irq; unsigned int addr;
unsigned char pci_irq;
ip2config.type[i] = PCI;
status = ip2config.type[i] = PCI;
pci_read_config_dword(pci_dev_i, PCI_BASE_ADDRESS_1, &addr); status =
if ( addr & 1 ) { pci_read_config_dword(pci_dev_i, PCI_BASE_ADDRESS_1, &addr);
ip2config.addr[i]=(USHORT)(addr&0xfffe); if ( addr & 1 ) {
} else { ip2config.addr[i]=(USHORT)(addr&0xfffe);
printk( KERN_ERR "IP2: PCI I/O address error\n"); } else {
} printk( KERN_ERR "IP2: PCI I/O address error\n");
status = }
pci_read_config_byte(pci_dev_i, PCI_INTERRUPT_LINE, &pci_irq); status =
pci_read_config_byte(pci_dev_i, PCI_INTERRUPT_LINE, &pci_irq);
// If the PCI BIOS assigned it, lets try and use it. If we // If the PCI BIOS assigned it, lets try and use it. If we
// can't acquire it or it screws up, deal with it then. // can't acquire it or it screws up, deal with it then.
// if (!is_valid_irq(pci_irq)) { // if (!is_valid_irq(pci_irq)) {
// printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq); // printk( KERN_ERR "IP2: Bad PCI BIOS IRQ(%d)\n",pci_irq);
// pci_irq = 0; // pci_irq = 0;
// } // }
ip2config.irq[i] = pci_irq; ip2config.irq[i] = pci_irq;
} else { // ann error } else { // ann error
ip2config.addr[i] = 0; ip2config.addr[i] = 0;
if (status == PCIBIOS_DEVICE_NOT_FOUND) { if (status == PCIBIOS_DEVICE_NOT_FOUND) {
printk( KERN_ERR "IP2: PCI board %d not found\n", i ); printk( KERN_ERR "IP2: PCI board %d not found\n", i );
} else { } else {
pcibios_strerror(status); pcibios_strerror(status);
} }
} }
}
#endif /* ! 2_0_X */ #endif /* ! 2_0_X */
#else #else
printk( KERN_ERR "IP2: PCI card specified but PCI support not\n"); printk( KERN_ERR "IP2: PCI card specified but PCI support not\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment