From patchwork Mon Sep 5 12:36:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9313615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BBFDB607D3 for ; Mon, 5 Sep 2016 12:41:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD39B28A6A for ; Mon, 5 Sep 2016 12:41:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1C4328A7B; Mon, 5 Sep 2016 12:41:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 370E628A6A for ; Mon, 5 Sep 2016 12:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755908AbcIEMkz (ORCPT ); Mon, 5 Sep 2016 08:40:55 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:36245 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755254AbcIEMje (ORCPT ); Mon, 5 Sep 2016 08:39:34 -0400 Received: by mail-lf0-f45.google.com with SMTP id g62so125862721lfe.3 for ; Mon, 05 Sep 2016 05:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2Pv178VJFk6riJ2Qiyzt7qwt+qnSmPRvMmc1NyfDZMk=; b=SHbyo5ty8N5xPUsaAqUJWg8sj73lyHymKywue2QtDHntXszhymU/llL1R85ukAWFWY C5gChHrwm0wSSDONlB2XvnegQ/Ngi20NUZFe0Ctj4bUrhbX7fq+nkzSBMKujQgptG1gu gWb5MM8PTPegdYwv9jck847sWJlSMfCyU9uaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2Pv178VJFk6riJ2Qiyzt7qwt+qnSmPRvMmc1NyfDZMk=; b=maWifp1PG7EiPp2vDQt79QD0V91lGQ4YCCjMaTcyxNxvenmxJRQhPqJ/4tb3bc5pnz t7l+9nbol0Kc62osmKIp3x0kqQBoEbomflSCeWga40SOeMN3XX/sSJHDmUaIHDpKMwvD 9Cb2kylGDAVqpAVBNyhwv9QuCIAlvWli5/xpRcGwE8bcU6VBJAwOYLGYnvN7GjgNm8ys 3c22x1TSmmZpNQdGApmpxvTZR+hZax4ER/FG4wZjVb1/rUoCDWtQs7nUDGm6+0smLRiS ehv7oHEDQTCoC10dlCigQa093a+AUVyBOhQTJ9mX6KgjNh2sBrW8QfdLZY6t+t9WzmeP AXAA== X-Gm-Message-State: AE9vXwP4J4pPy7aYPlGtHwpbhn2c0f1diiRiJfxWGwmRdmie7PGR4ZRiAt6YZXRS061U+XaE X-Received: by 10.25.87.12 with SMTP id l12mr8098634lfb.153.1473079172774; Mon, 05 Sep 2016 05:39:32 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id v82sm3134160lfi.30.2016.09.05.05.39.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Sep 2016 05:39:32 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" Cc: linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , Russell King , Greg Kroah-Hartman , Len Brown , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Yury Norov , Peter Hurley , Andy Shevchenko , "Zheng, Lv" , Mark Salter , Kefeng Wang , Rob Herring , Frank Rowand , Jiri Slaby , devicetree@vger.kernel.org Subject: [PATCH v10 1/4] of/serial: move earlycon early_param handling to serial Date: Mon, 5 Sep 2016 15:36:12 +0300 Message-Id: <20160905123617.18775-2-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160905123617.18775-1-aleksey.makarov@linaro.org> References: <20160905123617.18775-1-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leif Lindholm We have multiple "earlycon" early_param handlers - merge the DT one into the main earlycon one. It's a cleanup that also will be useful to defer setting up DT console until ACPI/DT decision is made. Rename the exported function to avoid clashing with the function from arch/microblaze/kernel/prom.c Signed-off-by: Leif Lindholm Signed-off-by: Aleksey Makarov Acked-by: Rob Herring Acked-by: Greg Kroah-Hartman Reviewed-by: Peter Hurley Tested-by: Kefeng Wang Tested-by: Christopher Covington --- drivers/of/fdt.c | 11 +---------- drivers/tty/serial/earlycon.c | 2 +- include/linux/of_fdt.h | 3 +++ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 085c638..c89d5d2 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node) #ifdef CONFIG_SERIAL_EARLYCON -static int __init early_init_dt_scan_chosen_serial(void) +int __init early_init_dt_scan_chosen_stdout(void) { int offset; const char *p, *q, *options = NULL; @@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void) } return -ENODEV; } - -static int __init setup_of_earlycon(char *buf) -{ - if (buf) - return 0; - - return early_init_dt_scan_chosen_serial(); -} -early_param("earlycon", setup_of_earlycon); #endif /** diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 067783f..7aae655 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf) * don't generate a warning from parse_early_params() in that case */ if (!buf || !buf[0]) - return 0; + return early_init_dt_scan_chosen_stdout(); err = setup_earlycon(buf); if (err == -ENOENT || err == -EALREADY) diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 26c3302..4341f32 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -14,6 +14,7 @@ #include #include +#include /* Definitions used by the flattened device tree */ #define OF_DT_HEADER 0xd00dfeed /* marker */ @@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, int depth, void *data); extern int early_init_dt_scan_memory(unsigned long node, const char *uname, int depth, void *data); +extern int early_init_dt_scan_chosen_stdout(void); extern void early_init_fdt_scan_reserved_mem(void); extern void early_init_fdt_reserve_self(void); extern void early_init_dt_add_memory_arch(u64 base, u64 size); @@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *); extern u64 of_flat_dt_translate_address(unsigned long node); extern void of_fdt_limit_memory(int limit); #else /* CONFIG_OF_FLATTREE */ +static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; } static inline void early_init_fdt_scan_reserved_mem(void) {} static inline void early_init_fdt_reserve_self(void) {} static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }