From patchwork Fri Aug 12 11:07:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 73844 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp115791qga; Fri, 12 Aug 2016 04:09:03 -0700 (PDT) X-Received: by 10.66.14.161 with SMTP id q1mr26356720pac.103.1471000143575; Fri, 12 Aug 2016 04:09:03 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si8501792pfj.237.2016.08.12.04.09.03; Fri, 12 Aug 2016 04:09:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbcHLLJA (ORCPT + 2 others); Fri, 12 Aug 2016 07:09:00 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:35968 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751636AbcHLLI7 (ORCPT ); Fri, 12 Aug 2016 07:08:59 -0400 Received: by mail-wm0-f43.google.com with SMTP id q128so21893112wma.1 for ; Fri, 12 Aug 2016 04:08:58 -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=UQGF8qjorFMp/5UgP5Dr+QVWGvZMPipOKmt+D9MCEEs=; b=C3pneg9JP6ZlDzVf67zSh5BgyfVfxm3T5ZAOEkZjvFGBz299oo6Bo0aJt8wZKHZs4S UTqUpwAbfBQHaVobPcor6SQs8j1XMqJzthSyty8GljQLxF5xn1glU++ACS9NoVoxccnI ZbfCoeFWRzf4Xn4wVuFNYDJ/9yT4N24qRtu7A= 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=UQGF8qjorFMp/5UgP5Dr+QVWGvZMPipOKmt+D9MCEEs=; b=QRwVyF6IzTVLchEl+04alnOVKx5WMhzXFvG2EV/KkQ31H7FVLZ9WYPXKVaRrsMWxA3 agBShkW9B9yrMvKIMaV0/uoWRRd44SvT7a+dJNH+mSxEEMinmMPGofqVFjzGl0F7k359 N4SUYmUP6EwmDzOuh+F6omzxkdZFRWwX9c3E00yf4bT9WW/LFvGq+GXzg0XtgluFU/r3 lv0mh5qoxN6SiNkQGZxGfYj+DguY7BqFwli0rg8SdnCIKmtVfCMnm1U+bIoyCstCykMo zkXQj0ndu3khcW/0u+rOrqiTQr9c7DV7aWvVD43ipVSUqw5bdZ32G1wxpnben61Ul4WE 9xvg== X-Gm-Message-State: AEkoouuoXIkuDhkawYyFM/2S/lFgoHoWVYmH+eVrcXgvs5wtCVCBgxjHJ2eUgph8u6v9a0/T X-Received: by 10.25.22.152 with SMTP id 24mr2411296lfw.180.1471000137234; Fri, 12 Aug 2016 04:08:57 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id 136sm1306419ljj.0.2016.08.12.04.08.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Aug 2016 04:08:56 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" , Greg Kroah-Hartman 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 , 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 v9 1/4] of/serial: move earlycon early_param handling to serial Date: Fri, 12 Aug 2016 14:07:14 +0300 Message-Id: <20160812110717.12351-1-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.9.2 In-Reply-To: <201608120110.sf8xniKf%fengguang.wu@intel.com> References: <201608120110.sf8xniKf%fengguang.wu@intel.com> Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 --- drivers/of/fdt.c | 11 +---------- drivers/tty/serial/earlycon.c | 2 +- include/linux/of_fdt.h | 3 +++ 3 files changed, 5 insertions(+), 11 deletions(-) -- 2.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 55f1b83..741cac53 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; }