From: Yoichi Yuasa <[email-masked]>

This patch updates serial driver for VR41xx serial unit.  Some check are
added to verify_port.

Signed-off-by: Yoichi Yuasa <[email-masked]>
Cc: Russell King <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 25-akpm/drivers/serial/vr41xx_siu.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff -puN drivers/serial/vr41xx_siu.c~serial-update-vr41xx_siu drivers/serial/vr41xx_siu.c
--- 25/drivers/serial/vr41xx_siu.c~serial-update-vr41xx_siu	2005-03-07 20:41:38.000000000 -0800
+++ 25-akpm/drivers/serial/vr41xx_siu.c	2005-03-07 20:41:38.000000000 -0800
@@ -702,15 +702,17 @@ static void siu_release_port(struct uart
 static int siu_request_port(struct uart_port *port)
 {
 	unsigned long size;
+	struct resource *res;
 
 	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;
 
 	if (port->flags & UPF_IOREMAP) {
 		port->membase = ioremap(port->mapbase, size);
 		if (port->membase == NULL) {
-			release_mem_region(port->mapbase, size);
+			release_resource(res);
 			return -ENOMEM;
 		}
 	}
@@ -730,6 +732,12 @@ static int siu_verify_port(struct uart_p
 {
 	if (port->type != PORT_VR41XX_SIU && port->type != PORT_VR41XX_DSIU)
 		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;
 }
_