[PATCH 2.6.11-rc5-mm1] serial: update vr41xx_siu

From: Yoichi Yuasa
Date: Wed Mar 02 2005 - 21:00:24 EST


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

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@xxxxxxxxxxxxxx>

diff -urN -X dontdiff a-orig/drivers/serial/vr41xx_siu.c a/drivers/serial/vr41xx_siu.c
--- a-orig/drivers/serial/vr41xx_siu.c Wed Mar 2 01:04:39 2005
+++ a/drivers/serial/vr41xx_siu.c Wed Mar 2 07:40:25 2005
@@ -702,15 +702,17 @@
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;
}
}
@@ -729,6 +731,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)
+ 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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/