From patchwork Tue Mar 22 10:46:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 8639711 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 4598BC0553 for ; Tue, 22 Mar 2016 10:49:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5365420398 for ; Tue, 22 Mar 2016 10:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DC2C2038A for ; Tue, 22 Mar 2016 10:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759178AbcCVKs7 (ORCPT ); Tue, 22 Mar 2016 06:48:59 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:34446 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758982AbcCVKsu (ORCPT ); Tue, 22 Mar 2016 06:48:50 -0400 Received: by mail-lb0-f179.google.com with SMTP id k12so155407418lbb.1 for ; Tue, 22 Mar 2016 03:48:49 -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=mwD9hFAvTG7yIRruxSASy6bmC4w+BwO2ZrmMLBOXgh4=; b=AocoXJilmhAIfxjlDIzsSIbwhzHTXUQrqVxxFWkGf/Eg4Lh4p/3GZ1UTtItAjW7Z4O vjeTeHCN09KB4RnQqmwHl1Vyk313Tto6Ag4DpsRoj/vEO6TOpWBAtw/DWfXZsnr+LKyz YlYlmrDjV2InNCPBuuw0KksP6VzQFv4x0kGMQ= 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=mwD9hFAvTG7yIRruxSASy6bmC4w+BwO2ZrmMLBOXgh4=; b=m7oVvMQRbEUpY2MQ+cjCcmOd3XCx/+15hwgGvF8HulVIj5JCD2Nw695js2JVHA3hEI bZCiqzp+V2fdUkGObSsewbAei+E3kTmgYVG1GrWFeP7EDGd2YmB8sZ/bJTRJqJ0MyOJz UNUuWRjyXDDB3Xzq/TgU9gaf9LtW0Vhkj1QmMu89Wb2cQvCuu8T3kGy5vFXVfiLOgBN2 qNcSJ6CnHapnpUTvX+8LGBSFT8vGUKGbKVm1DI21cOg3YxPjvWHW6RRcw28JVIXrsZRT 1yNBocisdiJNQSAnR/moNhEkWt5/1md/1fD0BuZJoN8KyJvID4T9XTdJlv3CfUtOnkzQ 95AQ== X-Gm-Message-State: AD7BkJKNtLpnPub1/IwPjomzIvXTU7ygIcmWfjVDHQzuC7N/S1lnhN6W3ZxsYioRkpdax9/p X-Received: by 10.25.141.2 with SMTP id p2mr1871220lfd.10.1458643728012; Tue, 22 Mar 2016 03:48:48 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id l5sm5022910lfd.22.2016.03.22.03.48.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 03:48:47 -0700 (PDT) From: Aleksey Makarov To: Greg Kroah-Hartman , "Rafael J . Wysocki" , Len Brown Cc: linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Aleksey Makarov , Russell King , Leif Lindholm , Graeme Gregory , Al Stone , Christopher Covington , Yury Norov , Peter Hurley , "Zheng, Lv" , Rob Herring , Frank Rowand , Grant Likely , Jiri Slaby , devicetree@vger.kernel.org Subject: [PATCH v5 1/6] of/serial: move earlycon early_param handling to serial Date: Tue, 22 Mar 2016 13:46:28 +0300 Message-Id: <1458643595-14719-2-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1458643595-14719-1-git-send-email-aleksey.makarov@linaro.org> References: <1458643595-14719-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,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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. It's a cleanup that also will be useful to decide if ACPI SPCR earlycon should be set up. 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; }