From patchwork Mon Feb 29 12:41:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 63204 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1223837lbc; Mon, 29 Feb 2016 04:43:24 -0800 (PST) X-Received: by 10.98.69.1 with SMTP id s1mr21721805pfa.120.1456749804332; Mon, 29 Feb 2016 04:43:24 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h7si3212675pat.114.2016.02.29.04.43.24; Mon, 29 Feb 2016 04:43:24 -0800 (PST) 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; 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; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbcB2MnM (ORCPT + 1 other); Mon, 29 Feb 2016 07:43:12 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:33539 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754720AbcB2MnF (ORCPT ); Mon, 29 Feb 2016 07:43:05 -0500 Received: by mail-lf0-f50.google.com with SMTP id m1so90601058lfg.0 for ; Mon, 29 Feb 2016 04:43:04 -0800 (PST) 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=Vb5ligh7p3dLX5hoaNgg6B5jAucBvFWUDUxu2Vgg66E=; b=jpo2UjVQbj3ANhpI6twqtODwTnGV0mH0A0ZhKsddqWlLPiO1y0qaJXQVgCYuxt/4Hs uzx3JkZNaJ8dfPXI6RkA/4rQxCxXMMZlYFPYWlMqTBVRESi9DxcCM6VCGrAxRWcTn0X4 ZA0NarPNszFlzkDO/NO4Be4+GZ5wHr8U3TbKw= 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=Vb5ligh7p3dLX5hoaNgg6B5jAucBvFWUDUxu2Vgg66E=; b=UORUgLnKVEEMXMQARdJRXAjE90ZzUNHkaWfXcOtedjwaYwiUPbkopl1XoQyt/Bry63 ViqzTilbt70HRg4FLDR+E1/jGvq8Fs1sJx4+zg+9EiBmEy1/HNaEZD3AtSR79iSkREra 2p4pL7MgmoiAI+9CbkKy+YbARLJFkUCduAHT8eD9QnCVu/RWBX0ijsQ3fCqIoMXW16oy ZlZsOeUlDQMMUuD7pbv0rXy91d1cCoIGntOqGOEcsL6D3K6E2GQxeZQR24FtQuODMF7U wbEnNKezV0rkALcejNvr8Ydpvtq75c9RoeF2fKiU11+R6+n3R6wQK+bI+KhAfERZk+lv JJAQ== X-Gm-Message-State: AD7BkJJMlMrSesllervck6D99ozuNxf+HTdUSA569Wet3JIr2GfCh02/kvA9YBTNLddcmN6l X-Received: by 10.25.135.198 with SMTP id j189mr5623465lfd.84.1456749783417; Mon, 29 Feb 2016 04:43:03 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id ke9sm3929150lbc.28.2016.02.29.04.43.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 04:43:02 -0800 (PST) From: Aleksey Makarov To: linux-acpi@vger.kernel.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , Russell King , Greg Kroah-Hartman , "Rafael J . Wysocki" , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Matthias Brugger , Rob Herring , Frank Rowand , Grant Likely , Jiri Slaby , devicetree@vger.kernel.org Subject: [PATCH v3 1/7] of/serial: move earlycon early_param handling to serial Date: Mon, 29 Feb 2016 15:41:58 +0300 Message-Id: <1456749726-30261-2-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456749726-30261-1-git-send-email-aleksey.makarov@linaro.org> References: <1456749726-30261-1-git-send-email-aleksey.makarov@linaro.org> 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. This means the earlycon early_param handler does not just return success if no options are specified. Signed-off-by: Leif Lindholm Signed-off-by: Aleksey Makarov --- drivers/of/fdt.c | 11 +---------- drivers/tty/serial/earlycon.c | 3 ++- include/linux/of_fdt.h | 2 ++ 3 files changed, 5 insertions(+), 11 deletions(-) -- 2.7.1 -- 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 3349d2a..0547256 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_serial(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..d217366 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -209,7 +210,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_serial(); 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..56b2a43 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_serial(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_serial(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; }