From patchwork Wed Feb 24 17:10:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 62810 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2526304lbl; Wed, 24 Feb 2016 09:11:04 -0800 (PST) X-Received: by 10.98.86.139 with SMTP id h11mr56219096pfj.105.1456333864861; Wed, 24 Feb 2016 09:11:04 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gj3si5979932pac.243.2016.02.24.09.11.04; Wed, 24 Feb 2016 09:11:04 -0800 (PST) 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; 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758211AbcBXRLA (ORCPT + 30 others); Wed, 24 Feb 2016 12:11:00 -0500 Received: from mail-lf0-f48.google.com ([209.85.215.48]:33000 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758083AbcBXRKz (ORCPT ); Wed, 24 Feb 2016 12:10:55 -0500 Received: by mail-lf0-f48.google.com with SMTP id m1so16313326lfg.0 for ; Wed, 24 Feb 2016 09:10:54 -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=Ms31xO9nYGF6QbYcQ246rZbA+hyF5ZK2h8/4oFM2dnYpUST7oXPzczKjpJQgVMcOEp H5tK8+rzBCLwmqI377Hsgvqw4iBAE0fPqMAV+Ez2AHfXs5cG69UFVvJeF548DI9EW3jd cVP16re/mxeqVLjwmIWdTOvsEu1JwA1G0SQ7o= 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=PdmjquU0cy2287JsfjsS9o8NggaYVBeEmMzQ4wlMLiL/k3laTFzyEg4kOozubb7lKb XkYWF0lHk2xPKM9HKK29NKR+N4XQSvNm5zhJtLP1lbB6LIllDgQlf9SJNceW/PAFK2Bl Qxn04R5iHNgNdIbgRwQoyw9eh4iDh0ZNSR83Gyw2V+N4JTlfQo73WR9LpqwPq9Rc0/ud PSE7zpTWf7hSjm7l2CXFGDMH7pz2CWGF65NIQs6tyKSJvwSv/zNnWTAr6glaIlA5CWuz jJh4pDdQYdctGhztqtk8mjGHfvRTfedi9WLa8Jby9+0we1iR99AoS6cjDBbRQQanZrNl MLmw== X-Gm-Message-State: AG10YOQ/12N2RonMBrXz9Pjh0888mgavKy3XMGIQEfSP5BRXNK9kaOrjSD2CP/OuSHACXVBS X-Received: by 10.25.149.145 with SMTP id x139mr12879790lfd.141.1456333853794; Wed, 24 Feb 2016 09:10:53 -0800 (PST) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id ne8sm509556lbc.21.2016.02.24.09.10.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Feb 2016 09:10:53 -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 , Rob Herring , Frank Rowand , Grant Likely , Jiri Slaby , devicetree@vger.kernel.org Subject: [PATCH v2 2/8] of/serial: move earlycon early_param handling to serial Date: Wed, 24 Feb 2016 20:10:11 +0300 Message-Id: <1456333819-13482-3-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456333819-13482-1-git-send-email-aleksey.makarov@linaro.org> References: <1456333819-13482-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. 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 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; }