serial: sprd: Fix iotype
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 24 Feb 2015 17:06:34 +0000 (12:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 02:28:01 +0000 (03:28 +0100)
The Spreadtrum UART is accessed with mmio; declare the proper iotype.
Also prevent userspace from assigning any other iotype via
ioctl(TIOCSSERIAL).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sprd_serial.c

index be3ed3f4ad601e771248dacb633578e7295bee7d..2e6d63eabb2e3d597c6531efce6f96ef9a61b19f 100644 (file)
@@ -491,6 +491,8 @@ static int sprd_verify_port(struct uart_port *port,
                return -EINVAL;
        if (port->irq != ser->irq)
                return -EINVAL;
+       if (port->iotype != ser->io_type)
+               return -EINVAL;
        return 0;
 }
 
@@ -705,7 +707,7 @@ static int sprd_probe(struct platform_device *pdev)
        up->dev = &pdev->dev;
        up->line = index;
        up->type = PORT_SPRD;
-       up->iotype = SERIAL_IO_PORT;
+       up->iotype = UPIO_MEM;
        up->uartclk = SPRD_DEF_RATE;
        up->fifosize = SPRD_FIFO_SIZE;
        up->ops = &serial_sprd_ops;