Commit 08d081db authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Linus Torvalds

[PATCH] serial: update vr41xx_siu

This patch updates serial driver for VR41xx serial unit.  Some check are
added to verify_port.
Signed-off-by: default avatarYoichi Yuasa <yuasa@hh.iij4u.or.jp>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3a667d2e
...@@ -702,15 +702,17 @@ static void siu_release_port(struct uart_port *port) ...@@ -702,15 +702,17 @@ static void siu_release_port(struct uart_port *port)
static int siu_request_port(struct uart_port *port) static int siu_request_port(struct uart_port *port)
{ {
unsigned long size; unsigned long size;
struct resource *res;
size = siu_port_size(port); size = siu_port_size(port);
if (request_mem_region(port->mapbase, size, siu_type_name(port)) == NULL) res = request_mem_region(port->mapbase, size, siu_type_name(port));
if (res == NULL)
return -EBUSY; return -EBUSY;
if (port->flags & UPF_IOREMAP) { if (port->flags & UPF_IOREMAP) {
port->membase = ioremap(port->mapbase, size); port->membase = ioremap(port->mapbase, size);
if (port->membase == NULL) { if (port->membase == NULL) {
release_mem_region(port->mapbase, size); release_resource(res);
return -ENOMEM; return -ENOMEM;
} }
} }
...@@ -730,6 +732,12 @@ static int siu_verify_port(struct uart_port *port, struct serial_struct *serial) ...@@ -730,6 +732,12 @@ static int siu_verify_port(struct uart_port *port, struct serial_struct *serial)
{ {
if (port->type != PORT_VR41XX_SIU && port->type != PORT_VR41XX_DSIU) if (port->type != PORT_VR41XX_SIU && port->type != PORT_VR41XX_DSIU)
return -EINVAL; return -EINVAL;
if (port->irq != serial->irq)
return -EINVAL;
if (port->iotype != serial->io_type)
return -EINVAL;
if (port->mapbase != (unsigned long)serial->iomem_base)
return -EINVAL;
return 0; 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