From patchwork Sat Sep 29 21:52:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 188078 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B88E32C00E3 for ; Sun, 30 Sep 2012 07:56:52 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F2D728317; Sat, 29 Sep 2012 23:56:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cvb9hlYAE9qS; Sat, 29 Sep 2012 23:56:50 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BDDF28280; Sat, 29 Sep 2012 23:53:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC62E281D8 for ; Sat, 29 Sep 2012 23:53:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nIkOIv7fDEMy for ; Sat, 29 Sep 2012 23:53:21 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id C8B93281E3 for ; Sat, 29 Sep 2012 23:53:16 +0200 (CEST) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XTk5m3s2jz4KK6F; Sat, 29 Sep 2012 23:53:16 +0200 (CEST) X-Auth-Info: 0kMBJ4M5vT71A6w0MuOBXELp8z+WpOiQYKMBREBa16U= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3XTk5m2VCxzbbfv; Sat, 29 Sep 2012 23:53:16 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 29 Sep 2012 23:52:11 +0200 Message-Id: <1348955586-7109-19-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1348955586-7109-1-git-send-email-marex@denx.de> References: <1348878687-14194-1-git-send-email-marex@denx.de> <1348955586-7109-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH 18/72] serial: zoom2: Remove zoom2 serial prototypes from serial.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Remove the prototypes for zoom2_serial_deviceN from serial.h . This can't be done right away, as they are referenced from the zoom2 config file. Therefore, adjust the code so the config file only specifies number of the port. Then, replace the simple return in default_serial_console() with a switch across possible values, which returns the zoom2_serial_deviceN . With such adjustment in place, the exported prototypes in serial.h can be safely removed. Signed-off-by: Marek Vasut Cc: Marek Vasut Cc: Tom Rini --- board/logicpd/zoom2/zoom2_serial.c | 7 ++++++- include/configs/omap3_zoom2.h | 2 +- include/serial.h | 7 ------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/board/logicpd/zoom2/zoom2_serial.c b/board/logicpd/zoom2/zoom2_serial.c index 74f165f..9b7aea8 100644 --- a/board/logicpd/zoom2/zoom2_serial.c +++ b/board/logicpd/zoom2/zoom2_serial.c @@ -135,5 +135,10 @@ QUAD_INIT (3) struct serial_device *default_serial_console(void) { - return ZOOM2_DEFAULT_SERIAL_DEVICE; + switch (ZOOM2_DEFAULT_SERIAL_DEVICE) { + case 0: return &zoom2_serial_device0; + case 1: return &zoom2_serial_device1; + case 2: return &zoom2_serial_device2; + case 3: return &zoom2_serial_device3; + } } diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h index 4447dff..a7cc5fc 100644 --- a/include/configs/omap3_zoom2.h +++ b/include/configs/omap3_zoom2.h @@ -81,7 +81,7 @@ * 0 - 1 : first USB with respect to the left edge of the debug board * 2 - 3 : second USB with respect to the left edge of the debug board */ -#define ZOOM2_DEFAULT_SERIAL_DEVICE (&zoom2_serial_device0) +#define ZOOM2_DEFAULT_SERIAL_DEVICE 0 #define V_NS16550_CLK (1843200) /* 1.8432 Mhz */ diff --git a/include/serial.h b/include/serial.h index 5f9899e..01a86b4 100644 --- a/include/serial.h +++ b/include/serial.h @@ -39,13 +39,6 @@ extern struct serial_device serial1_device; extern struct serial_device eserial1_device; extern struct serial_device eserial2_device; -#if defined(CONFIG_OMAP3_ZOOM2) -extern struct serial_device zoom2_serial_device0; -extern struct serial_device zoom2_serial_device1; -extern struct serial_device zoom2_serial_device2; -extern struct serial_device zoom2_serial_device3; -#endif - extern void serial_register(struct serial_device *); extern void serial_initialize(void); extern void serial_stdio_init(void);