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: 8409951 Return-Path: X-Original-To: patchwork-linux-acpi@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 2E7BAC0553 for ; Wed, 24 Feb 2016 17:13:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40227202AE for ; Wed, 24 Feb 2016 17:13:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 435C8202EC for ; Wed, 24 Feb 2016 17:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758106AbcBXRK7 (ORCPT ); Wed, 24 Feb 2016 12:10:59 -0500 Received: from mail-lf0-f52.google.com ([209.85.215.52]:33000 "EHLO mail-lf0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758098AbcBXRKz (ORCPT ); Wed, 24 Feb 2016 12:10:55 -0500 Received: by mail-lf0-f52.google.com with SMTP id m1so16313332lfg.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=A18unZPBt65eb5dN/GKYRv0j1QPgp+IGlvPj1hOAFmZ+75Ub//OkazTUGxVkKfAAe9 BltZcW8vkufwK186RWux9tTr9DuWEyO3SUK6ELwFeP81wB2O3K+bvgj5P/JYTfiGPBIq QIw+ntJmkCoJeGnSGfFJ4cS737b5YWay0ZJbQpx7UWcGs27vrZi/N5TXY2RmLinwc6hP Zo23FvGhTwSeyIuhaA8CMgpesWlpDcWIQ/fKtX0lsdoFHPxaQ5dE4DOYyya19M6hAK/J IPGRxWqXg2UgrdAuAVo49AOYUwE7gwFwe9rAAFFLbc9PKqidkBTD1jBNO6ObeE14nffQ slwQ== X-Gm-Message-State: AG10YOR4qLFS5R2RvPt51u9pOgi1frTcPfAhewCU+nmEJE9BsYEFsMaFEVIAFrxaLjPylr/U 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-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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; }