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: 8409921 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCD82C0553 for ; Wed, 24 Feb 2016 17:13:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE09E202E9 for ; Wed, 24 Feb 2016 17:13:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6587202AE for ; Wed, 24 Feb 2016 17:13:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYcyi-0007QL-0O; Wed, 24 Feb 2016 17:11:56 +0000 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aYcy3-00077b-OK for linux-arm-kernel@lists.infradead.org; Wed, 24 Feb 2016 17:11:17 +0000 Received: by mail-lf0-x236.google.com with SMTP id m1so16313328lfg.0 for ; Wed, 24 Feb 2016 09:10:55 -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=M9PrGBiYl0t24YC24UyxxG6vJr+uNZnh1aLLUZGdeRUYY/RpYxBF4qi0K2pQckDrYN VGDZAeT5sz8YsFF8qdLnx/lCID7+eHhotMatjHhEfdC8pyU/ZCp5Ti64DcfnU1Rm6yYi Pvtj8LoGlLX12WHyfwPBqL1juEuSKxPmy/Xz9hFd0enbgxHDIprmZxW1sViIti0yGifC VJIQvNIUvAGcbjZnKQK+W+00dahPBMeF7eUv8bo1Cng62IUJsAvCH91GOOwBLzmUhils LgCOcjhgYJkf9rAHsMbmnRl8C7HoW+6VF7e9amGK4RUcrtEQhhFujUi6XENKY6yxbO6Q eugw== X-Gm-Message-State: AG10YOQJW8kRgTxHVylyavZY9skah7oKrbtpmECGilif/CrIrxUupXet9bpQEY6JbLSMgxV+ 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160224_091116_108597_97A0DE76 X-CRM114-Status: GOOD ( 15.70 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Russell King , Graeme Gregory , Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Leif Lindholm , Aleksey Makarov , Rob Herring , Christopher Covington , linux-serial@vger.kernel.org, Jiri Slaby , Grant Likely , Frank Rowand , Al Stone , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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. 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(-) 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; }