Skip to content

Commit

Permalink
serial: sprd: Fix iotype
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Mar 7, 2015
1 parent 17b8f2a commit 7950dc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/sprd_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7950dc5

Please sign in to comment.