From patchwork Thu Mar 31 13:40:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 64785 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp166376lbc; Thu, 31 Mar 2016 06:43:36 -0700 (PDT) X-Received: by 10.98.75.147 with SMTP id d19mr21878008pfj.29.1459431812902; Thu, 31 Mar 2016 06:43:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si14212456pfk.202.2016.03.31.06.43.32; Thu, 31 Mar 2016 06:43:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757045AbcCaNnR (ORCPT + 29 others); Thu, 31 Mar 2016 09:43:17 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:35439 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756815AbcCaNnD (ORCPT ); Thu, 31 Mar 2016 09:43:03 -0400 Received: by mail-lb0-f171.google.com with SMTP id bc4so52806605lbc.2 for ; Thu, 31 Mar 2016 06:43:02 -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=NZj//9TlQs9FqHvZCpSuJMBP7MK4XoRJ4rIKWOwDWAM=; b=GvuDbFEiUnXr7x5oOBoTxBJkFrbQjramxCdhGH0SPX1u/APetvBFCK7D35EqbUNmFS daycBjf5liC3ckAH9n89P8F1r+I0FIFbTwFYnYghFHtei1nCEyj/Pd/zAevBwi8e6Ku9 WGdfDBZLOYEaMNCHQyNeG3WnRrL5l1O0aQe0o= 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=NZj//9TlQs9FqHvZCpSuJMBP7MK4XoRJ4rIKWOwDWAM=; b=fqwM9yROvsfls3uZAzEx3Sh49sNaoh4u9jjzwpk37A0850IsdoSdFAbRw+XUQA3RpX PVhS5QpTqu7Btfqgbg50qHMYX7SFGWQtEZGlTdSEjktRZGgOx+HpzaE7GN3wpCmsQZHU 6JK0PDvqc5IRvpg0MTP0OPE1askv66/JQZ0exGpWy3Zk9+toUHI/x83z4Y0LBuaper/b PRxj37ydwDs8YBmNaQq2K0wTpBhigJBjH3gMvLywIAl3n5wAdzOzjuVNZ/+FfyEksf/m M3dUJtzRQzV8gC5zhif4hbbSk+eaaZCvFvZqwiFnrpRu465h3dzGlly/gRpDSGJFP85o Xd8w== X-Gm-Message-State: AD7BkJIETSIvoiH9HPE+dTJCqVM20h9zpiPQSu6HtGXD0GdzGRuYSaYRPYXjlA3Vo0ev2Afw X-Received: by 10.112.235.195 with SMTP id uo3mr5602162lbc.18.1459431781681; Thu, 31 Mar 2016 06:43:01 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id mi9sm1285984lbc.27.2016.03.31.06.43.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 06:43:00 -0700 (PDT) From: Aleksey Makarov To: Russell King , 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 , "Rafael J . Wysocki" , Len Brown , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Yury Norov , Peter Hurley , Andy Shevchenko , "Zheng, Lv" , Rob Herring , Frank Rowand , Grant Likely , Jiri Slaby , devicetree@vger.kernel.org Subject: [PATCH v7 1/5] of/serial: move earlycon early_param handling to serial Date: Thu, 31 Mar 2016 16:40:23 +0300 Message-Id: <1459431629-27934-2-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org> References: <1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- drivers/of/fdt.c | 11 +---------- drivers/tty/serial/earlycon.c | 2 +- include/linux/of_fdt.h | 2 ++ 3 files changed, 4 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 3349d2a..b50f775 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -805,7 +805,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; @@ -849,15 +849,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 2fbe868..5cfe322 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -63,6 +63,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); @@ -91,6 +92,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; }