From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756295AbbCFTZx (ORCPT ); Fri, 6 Mar 2015 14:25:53 -0500 Received: from mail-qg0-f46.google.com ([209.85.192.46]:46212 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756085AbbCFTZo (ORCPT ); Fri, 6 Mar 2015 14:25:44 -0500 From: Peter Hurley To: Greg Kroah-Hartman , Rob Herring , Grant Likely Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hurley Subject: [PATCH v2 -next 03/14] serial: earlycon: Emit earlycon name in the OF table Date: Fri, 6 Mar 2015 14:25:19 -0500 Message-Id: <1425669930-22137-4-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> References: <1425669930-22137-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The OF device name of the earlycon is never used because there is no device; re-purpose the name field to store the earlycon name in the OF earlycon table. Earlycon will use the table entry to fixup the console name and index. Signed-off-by: Peter Hurley --- include/linux/serial_core.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 8aeec49..c523785 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #ifdef CONFIG_SERIAL_CORE_CONSOLE @@ -353,8 +354,18 @@ extern int of_setup_earlycon(unsigned long addr, = { .name = __stringify(_name), \ .setup = func } -#define OF_EARLYCON_DECLARE(name, compat, fn) \ - _OF_DECLARE(earlycon, name, compat, fn, void *) +#ifdef CONFIG_OF +#define EARLYCON_OF_TABLE_ATTR __used __section(__earlycon_of_table) +#else +#define EARLYCON_OF_TABLE_ATTR __attribute__((unused)) +#endif + +#define OF_EARLYCON_DECLARE(_name, compat, fn) \ + static const struct of_device_id __of_table_##_name \ + EARLYCON_OF_TABLE_ATTR \ + = { .name = __stringify(_name), \ + .compatible = compat, \ + .data = (fn == (void *)NULL) ? fn : fn } struct uart_port *uart_get_console(struct uart_port *ports, int nr, struct console *c); -- 2.3.1