From patchwork Tue Sep 8 12:43:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 53268 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 0ACBE22B05 for ; Tue, 8 Sep 2015 12:44:59 +0000 (UTC) Received: by lbcao8 with SMTP id ao8sf35082690lbc.1 for ; Tue, 08 Sep 2015 05:44:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=p5MbuWkEFuNbvFsh6ubo+C+SWzAWEryXw6akvJ/Begs=; b=JAdiHNLm0PjRc56mjGJn9tgiVsZCGnprNb330C1/zMp+QUqwqwdnSh5bpJqi/s+wkG WSEm+3i4TQnGNXMwTwDBeyMe09LiryVBRaNqtx+IJbU0+gq0kIR/Gpv4tGKguAt7bWW0 jVfQBNKSGfXUauNEA2ab83Y0QmCQt0o3XCZNt2LKz9or/IGxnHSrmys1R2+KF3xmAg8T VeyMoITU6lG6OPM0yA9DswWsqJ999Ra/S9XqQVVnqQdlbdO4rroa7Xk32X1B7Ee2Ga/1 4Q0DnUj7H8euWqAfovcGRNv2K0tXCOr3vh1rImZycgW5QNUPteheCzR3uW0PQoBFW9lX wUmQ== X-Gm-Message-State: ALoCoQmnL1EC6XnqHU0R1nS4LxhjhCmm2k7yng8ttilq6Ml5xQrvQG/i00PfaJ0kUf+zpvnrfvVe X-Received: by 10.112.170.67 with SMTP id ak3mr6462461lbc.6.1441716298039; Tue, 08 Sep 2015 05:44:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.166 with SMTP id n6ls647152laf.86.gmail; Tue, 08 Sep 2015 05:44:57 -0700 (PDT) X-Received: by 10.112.72.97 with SMTP id c1mr8407118lbv.86.1441716297851; Tue, 08 Sep 2015 05:44:57 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id o2si3127041laj.26.2015.09.08.05.44.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2015 05:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lagj9 with SMTP id j9so68907004lag.2 for ; Tue, 08 Sep 2015 05:44:57 -0700 (PDT) X-Received: by 10.152.18.164 with SMTP id x4mr22624467lad.35.1441716297570; Tue, 08 Sep 2015 05:44:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp951756lbq; Tue, 8 Sep 2015 05:44:56 -0700 (PDT) X-Received: by 10.60.69.200 with SMTP id g8mr19570585oeu.40.1441716291201; Tue, 08 Sep 2015 05:44:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gs1si5349590pac.67.2015.09.08.05.44.50; Tue, 08 Sep 2015 05:44:51 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754795AbbIHMoo (ORCPT + 28 others); Tue, 8 Sep 2015 08:44:44 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:37884 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754559AbbIHMnv (ORCPT ); Tue, 8 Sep 2015 08:43:51 -0400 Received: by wicfx3 with SMTP id fx3so113593162wic.0 for ; Tue, 08 Sep 2015 05:43:49 -0700 (PDT) X-Received: by 10.180.12.195 with SMTP id a3mr17697482wic.71.1441716229029; Tue, 08 Sep 2015 05:43:49 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by smtp.gmail.com with ESMTPSA id i7sm4696047wib.15.2015.09.08.05.43.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Sep 2015 05:43:48 -0700 (PDT) From: Leif Lindholm To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mark.rutland@arm.com, al.stone@linaro.org, torez@redhat.com, jcm@redhat.com, graeme.gregory@linaro.org, linaro-acpi@lists.linaro.org, lv.zheng@intel.com Subject: [RFC 2/5] of/serial: move earlycon early_param handling to serial Date: Tue, 8 Sep 2015 13:43:34 +0100 Message-Id: <1441716217-23786-3-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441716217-23786-1-git-send-email-leif.lindholm@linaro.org> References: <1441716217-23786-1-git-send-email-leif.lindholm@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- drivers/of/fdt.c | 11 +---------- drivers/tty/serial/earlycon.c | 4 +++- include/linux/of_fdt.h | 1 + 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 6e82bc42..fcfc4c7 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -793,7 +793,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node) #ifdef CONFIG_SERIAL_EARLYCON extern struct of_device_id __earlycon_of_table[]; -static int __init early_init_dt_scan_chosen_serial(void) +int __init early_init_dt_scan_chosen_serial(void) { int offset; const char *p; @@ -834,15 +834,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 f096360..2bda09a 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -187,7 +188,8 @@ 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; + if (IS_ENABLED(CONFIG_OF_FLATTREE)) + 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 df9ef38..772c47c 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);