From patchwork Sun Sep 16 23:20:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 184196 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 2BAC02C0080 for ; Mon, 17 Sep 2012 09:24:27 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 54CCC28282; Mon, 17 Sep 2012 01:24:24 +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 5N76E63RO1WE; Mon, 17 Sep 2012 01:24:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 342A2282DA; Mon, 17 Sep 2012 01:22:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CBD38282C3 for ; Mon, 17 Sep 2012 01:21:52 +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 U-5x8-X1Hoyx for ; Mon, 17 Sep 2012 01:21:52 +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 6E9B228272 for ; Mon, 17 Sep 2012 01:21:43 +0200 (CEST) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3XKmgn3jD9z4KK7d; Mon, 17 Sep 2012 01:21:41 +0200 (CEST) X-Auth-Info: anQ/cH2YIfW7MZRGB7bi3BS0Hyq2WSeq5ITpKa/hJDU= Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3XKmgn2Lghzbbcq; Mon, 17 Sep 2012 01:21:41 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 17 Sep 2012 01:20:27 +0200 Message-Id: <1347837696-3192-3-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347837696-3192-1-git-send-email-marex@denx.de> References: <1347837696-3192-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH 02/71] serial: Rename .init() and .uninit() in serial_device 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 Rename .init() to .start() and .uninit() to .stop() in struct serial_device. This allows aligning struct serial_device with closer to struct stdio_dev. The real goal here is to allow these two structures to converge together and eventually make one to be a superset of the other. Signed-off-by: Marek Vasut Cc: Marek Vasut Cc: Tom Rini --- arch/blackfin/cpu/serial.c | 4 ++-- common/serial.c | 16 ++++++++-------- include/serial.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/blackfin/cpu/serial.c b/arch/blackfin/cpu/serial.c index 6603dc0..33677ba 100644 --- a/arch/blackfin/cpu/serial.c +++ b/arch/blackfin/cpu/serial.c @@ -236,8 +236,8 @@ static void uart##n##_loop(int state) \ \ struct serial_device bfin_serial##n##_device = { \ .name = "bfin_uart"#n, \ - .init = uart##n##_init, \ - .uninit = uart##n##_uninit, \ + .start = uart##n##_init, \ + .stop = uart##n##_uninit, \ .setbrg = uart##n##_setbrg, \ .getc = uart##n##_getc, \ .tstc = uart##n##_tstc, \ diff --git a/common/serial.c b/common/serial.c index 75cc1bb..5740d4f 100644 --- a/common/serial.c +++ b/common/serial.c @@ -35,7 +35,7 @@ static struct serial_device *serial_current; void serial_register(struct serial_device *dev) { #ifdef CONFIG_NEEDS_MANUAL_RELOC - dev->init += gd->reloc_off; + dev->start += gd->reloc_off; dev->setbrg += gd->reloc_off; dev->getc += gd->reloc_off; dev->tstc += gd->reloc_off; @@ -136,8 +136,8 @@ void serial_stdio_init(void) strcpy(dev.name, s->name); dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT; - dev.start = s->init; - dev.stop = s->uninit; + dev.start = s->start; + dev.stop = s->stop; dev.putc = s->putc; dev.puts = s->puts; dev.getc = s->getc; @@ -168,7 +168,7 @@ void serial_reinit_all(void) struct serial_device *s; for (s = serial_devices; s; s = s->next) - s->init(); + s->start(); } static struct serial_device *get_current(void) @@ -188,7 +188,7 @@ static struct serial_device *get_current(void) int serial_init(void) { - return get_current()->init(); + return get_current()->start(); } void serial_setbrg(void) @@ -288,9 +288,9 @@ int uart_post_test(int flags) /* Disable loop back */ s->loop(0); - /* XXX: There is no serial_uninit() !? */ - if (s->uninit) - s->uninit(); + /* XXX: There is no serial_stop() !? */ + if (s->stop) + s->stop(); } done: diff --git a/include/serial.h b/include/serial.h index 8433ed7..eb1388c 100644 --- a/include/serial.h +++ b/include/serial.h @@ -7,8 +7,8 @@ struct serial_device { /* enough bytes to match alignment of following func pointer */ char name[16]; - int (*init)(void); - int (*uninit)(void); + int (*start)(void); + int (*stop)(void); void (*setbrg)(void); int (*getc)(void); int (*tstc)(void);