From b51e3f5ad5b2618702d689942dfaf7b15ea5eba4 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Tue, 3 Feb 2015 21:05:50 +0100 Subject: sprd_serial: compile sprd_suspend and sprd_resume conditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building sprd_serial.o when CONFIG_PM_SLEEP is not defined triggers these warnings: drivers/tty/serial/sprd_serial.c:755:12: warning: ‘sprd_suspend’ defined but not used [-Wunused-function] static int sprd_suspend(struct device *dev) ^ drivers/tty/serial/sprd_serial.c:764:12: warning: ‘sprd_resume’ defined but not used [-Wunused-function] static int sprd_resume(struct device *dev) ^ Let's compile these functions only when CONFIG_PM_SLEEP is defined. Signed-off-by: Paul Bolle Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sprd_serial.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/tty/serial/sprd_serial.c') diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 594b63331ef4..be3ed3f4ad60 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -752,6 +752,7 @@ static int sprd_probe(struct platform_device *pdev) return ret; } +#ifdef CONFIG_PM_SLEEP static int sprd_suspend(struct device *dev) { struct sprd_uart_port *sup = dev_get_drvdata(dev); @@ -769,6 +770,7 @@ static int sprd_resume(struct device *dev) return 0; } +#endif static SIMPLE_DEV_PM_OPS(sprd_pm_ops, sprd_suspend, sprd_resume); -- cgit v1.2.3 From 7950dc586092d0c7a8b881188061cc3dc133d7e9 Mon Sep 17 00:00:00 2001 From: Peter Hurley Date: Tue, 24 Feb 2015 12:06:34 -0500 Subject: serial: sprd: Fix iotype 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 Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sprd_serial.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/tty/serial/sprd_serial.c') diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index be3ed3f4ad60..2e6d63eabb2e 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -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; -- cgit v1.2.3