X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fparisc%2Fsuperio.c;h=ba971fecd0d8c32bbf6bd4ff39a9ada45a100732;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=828eb45062de3fa51182d1c61660961307fc0b11;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 828eb4506..ba971fecd 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c @@ -12,7 +12,6 @@ * (C) Copyright 2001 John Marvin * (C) Copyright 2003 Grant Grundler * (C) Copyright 2005 Kyle McMartin - * (C) Copyright 2006 Helge Deller * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -155,11 +154,11 @@ superio_init(struct pci_dev *pcidev) struct pci_dev *pdev = sio->lio_pdev; u16 word; - if (sio->suckyio_irq_enabled) + if (sio->suckyio_irq_enabled) return; - BUG_ON(!pdev); - BUG_ON(!sio->usb_pdev); + if (!pdev) BUG(); + if (!sio->usb_pdev) BUG(); /* use the IRQ iosapic found for USB INT D... */ pdev->irq = sio->usb_pdev->irq; @@ -194,7 +193,7 @@ superio_init(struct pci_dev *pcidev) request_region (sio->acpi_base, 0x1f, "acpi"); /* Enable the legacy I/O function */ - pci_read_config_word (pdev, PCI_COMMAND, &word); + pci_read_config_word (pdev, PCI_COMMAND, &word); word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO; pci_write_config_word (pdev, PCI_COMMAND, word); @@ -389,34 +388,43 @@ int superio_fixup_irq(struct pci_dev *pcidev) return local_irq; } +static struct uart_port serial[] = { + { + .iotype = UPIO_PORT, + .line = 0, + .type = PORT_16550A, + .uartclk = 115200*16, + .fifosize = 16, + }, + { + .iotype = UPIO_PORT, + .line = 1, + .type = PORT_16550A, + .uartclk = 115200*16, + .fifosize = 16, + } +}; + static void __devinit superio_serial_init(void) { #ifdef CONFIG_SERIAL_8250 int retval; - struct uart_port serial_port; - - memset(&serial_port, 0, sizeof(serial_port)); - serial_port.iotype = UPIO_PORT; - serial_port.type = PORT_16550A; - serial_port.uartclk = 115200*16; - serial_port.fifosize = 16; - spin_lock_init(&serial_port.lock); - - /* serial port #1 */ - serial_port.iobase = sio_dev.sp1_base; - serial_port.irq = SP1_IRQ; - serial_port.line = 0; - retval = early_serial_setup(&serial_port); + + serial[0].iobase = sio_dev.sp1_base; + serial[0].irq = SP1_IRQ; + spin_lock_init(&serial[0].lock); + + retval = early_serial_setup(&serial[0]); if (retval < 0) { printk(KERN_WARNING PFX "Register Serial #0 failed.\n"); return; } - /* serial port #2 */ - serial_port.iobase = sio_dev.sp2_base; - serial_port.irq = SP2_IRQ; - serial_port.line = 1; - retval = early_serial_setup(&serial_port); + serial[1].iobase = sio_dev.sp2_base; + serial[1].irq = SP2_IRQ; + spin_lock_init(&serial[1].lock); + retval = early_serial_setup(&serial[1]); + if (retval < 0) printk(KERN_WARNING PFX "Register Serial #1 failed.\n"); #endif /* CONFIG_SERIAL_8250 */ @@ -466,7 +474,8 @@ superio_probe(struct pci_dev *dev, const struct pci_device_id *id) dev->subsystem_vendor, dev->subsystem_device, dev->class); - BUG_ON(!sio->suckyio_irq_enabled); /* Enabled by PCI_FIXUP_FINAL */ + if (!sio->suckyio_irq_enabled) + BUG(); /* Enabled by PCI_FIXUP_FINAL */ if (dev->device == PCI_DEVICE_ID_NS_87560_LIO) { /* Function 1 */ superio_parport_init();