From patchwork Wed Oct 1 16:42:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 5013411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB21ABEEA6 for ; Wed, 1 Oct 2014 16:46:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAFEA20211 for ; Wed, 1 Oct 2014 16:46:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8C7720155 for ; Wed, 1 Oct 2014 16:46:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZN0C-00016I-6m; Wed, 01 Oct 2014 16:43:44 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZN03-0000qF-QF for linux-arm-kernel@lists.infradead.org; Wed, 01 Oct 2014 16:43:36 +0000 Received: by mail-pa0-f44.google.com with SMTP id et14so576151pad.31 for ; Wed, 01 Oct 2014 09:43:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dn831IFm5NoKI1ofFN/fFrTlmAIqGBqR/zX2iVBdxdk=; b=0+nS4D/+zgxTVLmW9TnPOTuQjSKDRFGvWNH6PTx6Dgiu4a5u6l+I9tcTZUGfS1aN24 1WtzauusOiRUXr4K9pB4uWj0Dkp1krBEEg45Lp0i4BrJzMkP9f+T3+HvoRuBWBLvMr0i Ay6xArVNvRmeFY/cGYkqH/49dA/s0GfzHCnWIOv7t9eZnw5P5Zk/qO9kIMiQH7rtmdPv FELvszwwo3Inm+wFWtxklEquHQeSlEsqEdbmF7ZlO4C42qE+XF+sSozZ1TbdpOQ0uzF2 g9GbyC7gwmsWuM2Nq9GtFT7EUbap9U09S1HmSurntI9Cih7M+74AYYipHcmDmjCXRs2r kqGg== X-Received: by 10.67.12.175 with SMTP id er15mr80429494pad.143.1412181794438; Wed, 01 Oct 2014 09:43:14 -0700 (PDT) Received: from localhost.localdomain ([122.172.104.240]) by mx.google.com with ESMTPSA id dh14sm1483621pac.17.2014.10.01.09.43.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Oct 2014 09:43:13 -0700 (PDT) From: Abhilash Kesavan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/2] tty: serial: samsung: Clean-up selection of number of available UARTs Date: Wed, 1 Oct 2014 22:12:57 +0530 Message-Id: <1412181777-6388-2-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1412181777-6388-1-git-send-email-a.kesavan@samsung.com> References: <1412181777-6388-1-git-send-email-a.kesavan@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141001_094335_874705_B6ABC50F X-CRM114-Status: GOOD ( 17.08 ) X-Spam-Score: -0.7 (/) Cc: gregkh@linuxfoundation.org, linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com, arnd@arndb.de, tomasz.figa@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove symbols SERIAL_SAMSUNG_UARTS_4 and SERIAL_SAMSUNG_UARTS which select the number of UART ports available on the SoC. Replace the usage of SERIAL_SAMSUNG_UARTS in the serial driver with the maximum number of UART ports possible. Removal of these symbols also helps in Exynos7 serial enablement. Signed-off-by: Abhilash Kesavan Reviewed-by: Tomasz Figa Cc: Greg Kroah-Hartman --- drivers/tty/serial/Kconfig | 16 ---------------- drivers/tty/serial/samsung.c | 11 +++-------- drivers/tty/serial/samsung.h | 5 ++++- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 81f6ee7..9fc9092 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -247,22 +247,6 @@ config SERIAL_SAMSUNG provide all of these ports, depending on how the serial port pins are configured. -config SERIAL_SAMSUNG_UARTS_4 - bool - depends on PLAT_SAMSUNG - default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442) - help - Internal node for the common case of 4 Samsung compatible UARTs - -config SERIAL_SAMSUNG_UARTS - int - depends on PLAT_SAMSUNG - default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 - default 3 - help - Select the number of available UART ports for the Samsung S3C - serial driver - config SERIAL_SAMSUNG_DEBUG bool "Samsung SoC serial debug" depends on SERIAL_SAMSUNG && DEBUG_LL diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index c78f43a..ba04c6d 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -962,14 +962,14 @@ static struct uart_ops s3c24xx_serial_ops = { static struct uart_driver s3c24xx_uart_drv = { .owner = THIS_MODULE, .driver_name = "s3c2410_serial", - .nr = CONFIG_SERIAL_SAMSUNG_UARTS, + .nr = MAX_SAMSUNG_UARTS, .cons = S3C24XX_SERIAL_CONSOLE, .dev_name = S3C24XX_SERIAL_NAME, .major = S3C24XX_SERIAL_MAJOR, .minor = S3C24XX_SERIAL_MINOR, }; -static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = { +static struct s3c24xx_uart_port s3c24xx_serial_ports[MAX_SAMSUNG_UARTS] = { [0] = { .port = { .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[0].port.lock), @@ -992,8 +992,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS .line = 1, } }, -#if CONFIG_SERIAL_SAMSUNG_UARTS > 2 - [2] = { .port = { .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[2].port.lock), @@ -1005,8 +1003,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS .line = 2, } }, -#endif -#if CONFIG_SERIAL_SAMSUNG_UARTS > 3 [3] = { .port = { .lock = __SPIN_LOCK_UNLOCKED(s3c24xx_serial_ports[3].port.lock), @@ -1018,7 +1014,6 @@ static struct s3c24xx_uart_port s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS .line = 3, } } -#endif }; /* s3c24xx_serial_resetport @@ -1590,7 +1585,7 @@ s3c24xx_serial_console_setup(struct console *co, char *options) /* is this a valid port */ - if (co->index == -1 || co->index >= CONFIG_SERIAL_SAMSUNG_UARTS) + if (co->index == -1 || co->index >= MAX_SAMSUNG_UARTS) co->index = 0; port = &s3c24xx_serial_ports[co->index].port; diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h index eb071dd..484b49e 100644 --- a/drivers/tty/serial/samsung.h +++ b/drivers/tty/serial/samsung.h @@ -1,6 +1,9 @@ #ifndef __SAMSUNG_H #define __SAMSUNG_H +/* Maximum UART ports available */ +#define MAX_SAMSUNG_UARTS 4 + /* * Driver for Samsung SoC onboard UARTs. * @@ -38,7 +41,7 @@ struct s3c24xx_uart_info { struct s3c24xx_serial_drv_data { struct s3c24xx_uart_info *info; struct s3c2410_uartcfg *def_cfg; - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; + unsigned int fifosize[MAX_SAMSUNG_UARTS]; }; struct s3c24xx_uart_port {