Commit b815b4b7 authored by Russell King's avatar Russell King

[SERIAL] 8250_gsc: Convert to use serial8250_{un,}register_port.

parent 3113fa59
......@@ -14,7 +14,7 @@
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/types.h>
......@@ -22,37 +22,18 @@
#include <asm/hardware.h>
#include <asm/parisc-device.h>
#include <asm/io.h>
#include <asm/serial.h>
#include <asm/serial.h> /* for LASI_BASE_BAUD */
static void setup_parisc_serial(struct serial_struct *serial,
unsigned long address, int irq, int line)
{
memset(serial, 0, sizeof(struct serial_struct));
/* autoconfig() sets state->type. This sets info->type */
serial->type = PORT_16550A;
serial->line = line;
serial->iomap_base = address;
serial->iomem_base = ioremap(address, 0x8);
serial->irq = irq;
serial->io_type = SERIAL_IO_MEM; /* define access method */
serial->flags = 0;
serial->xmit_fifo_size = 16;
serial->custom_divisor = 0;
serial->baud_base = LASI_BASE_BAUD;
}
#include "8250.h"
static int __init
serial_init_chip(struct parisc_device *dev)
{
static int serial_line_nr;
struct uart_port port;
unsigned long address;
int err;
struct serial_struct *serial;
if (!dev->irq) {
/* We find some unattached serial ports by walking native
* busses. These should be silently ignored. Otherwise,
......@@ -66,21 +47,23 @@ serial_init_chip(struct parisc_device *dev)
return -ENODEV;
}
serial = kmalloc(sizeof(*serial), GFP_KERNEL);
if (!serial)
return -ENOMEM;
address = dev->hpa;
if (dev->id.sversion != 0x8d) {
address += 0x800;
}
setup_parisc_serial(serial, address, dev->irq, serial_line_nr++);
err = register_serial(serial);
memset(&port, 0, sizeof(struct uart_port));
port.mapbase = address;
port.irq = dev->irq;
port.iotype = UPIO_MEM;
port.flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF;
port.uartclk = LASI_BASE_BAUD * 16;
port.dev = &dev->dev;
err = serial8250_register_port(&port);
if (err < 0) {
printk(KERN_WARNING "register_serial returned error %d\n", err);
kfree(serial);
return -ENODEV;
printk(KERN_WARNING "serial8250_register_port returned error %d\n", err);
return err;
}
return 0;
......
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