Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5469827rwj; Wed, 21 Dec 2022 03:09:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8t4/rCFm3Ea7ra2SpUxdqfiSmx96Cil6xxGuhVS3HZCJ1vZqC1YbJqVe6J5lgDFGUyGwN X-Received: by 2002:aa7:ccc2:0:b0:477:8ab8:43e0 with SMTP id y2-20020aa7ccc2000000b004778ab843e0mr1103094edt.2.1671620976350; Wed, 21 Dec 2022 03:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671620976; cv=none; d=google.com; s=arc-20160816; b=Wl1n1JWs/utIxLSl5B3bZHHOiCv6VI8Dnl8zrqOVB6YlPodqj/RHv7cY7b3zaD0vdN hFM0qa0MqIsDAuLbWfFvOwKnQphJ0qHlgU/DSHGg8mlS8eNMxva3RCXFdQRxaSUvUOWl 3a1NsdZKiiyJfkcEnrZotk6lPehq2Apl7JdLKGZLj5uFFIuoKdMr8KiFFEHLdbvPIOrs F68rdKRGxoH9jUpKY0Dh35/Wl7jRM9QJjlf3wHtf7CUi9rf4XXEfaGAeOe5irJhd26VI y+h8liQxswhNPoKMcVgoTF7Mjy4o+r7mod4RiFdZE0UGnDDuH3gsTYbVioKPCeum+16v vxhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bS2SuPyrrLQszLfTlNtHGbczRo/TVo6iehbioyR9aVQ=; b=C0A61St0kR7nP/qUCxWzaxsVjx1CwlVZYheJxoBBYUdHpZdC6DP3FffqrGsVvNJhrs YvIpYkxNa8X7Dsdm2QRYpqws03jt7BEN96lvSpsON6qoQyD2Ksl68mPe1WLP3zakTS0R qb0q0oBXgyGE3xjk9s5NQzhfPfn3FbbZYdE5Axxp1i14U2Fg7Utbw3s9ZmBliinWyew2 8HxBiIbWRpVHBTpRRk7L9dkvJ7n9R8GmQLIdXmwxRxi1MnFONOVK3IGuMqfM8P4GEDSq mgVqr22BUrZ3LUwM4e4XeaCZpiKVFeGxkTUuLyfMZyk3fWVOBzNl9updmZu4kh8PjNjh kSOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V5g9bWYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020aa7d385000000b0046ca3c3df50si3576440edq.211.2022.12.21.03.09.19; Wed, 21 Dec 2022 03:09:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V5g9bWYD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234586AbiLUKyq (ORCPT + 69 others); Wed, 21 Dec 2022 05:54:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234544AbiLUKyk (ORCPT ); Wed, 21 Dec 2022 05:54:40 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4CF20186; Wed, 21 Dec 2022 02:54:39 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id f18so14522613wrj.5; Wed, 21 Dec 2022 02:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bS2SuPyrrLQszLfTlNtHGbczRo/TVo6iehbioyR9aVQ=; b=V5g9bWYDeFiA79+HKnoNqj3Yrev9rnYg89t+lfD4CE7yyoy6A/NBcDsfmFhWul0zPC XDc1JLVjMnEPDvVhTn6fxwBTE96EKLlJSCjwaXsgARV3dYkyMXEZVIjg+U48zNHsMNK9 bgerLFXI3daey7af/Q8IU3a1iErE/XGHuqpeiZeO15b9n3cAFRlTuWe9rFKR+q8gmTu/ uJkQqcPeHSQh9wnCU+fwj/O436GrmycxV2r4YbGjUxkgBG+mWgnbFURsYO1q96q7/T1E KuUTEq2lKbAfkhe0WSDEnA7xfWpVsZ1nd5FHenfwuN8O6LIWqLkzF4a1VEnCTTqEBAU9 9PVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bS2SuPyrrLQszLfTlNtHGbczRo/TVo6iehbioyR9aVQ=; b=oilS7gJMYcCLOaclsdJ9ogv8kARzlmpoUbsPee4ZB9FTvffXGqbKu4+auOlAYhF5zx qFQZpPlrgkawCA0A3R1HXpENwAXgU4LkjEULo2vNgYP2p9qxn6GTPTH1gwZ4td1HY/g7 sX1jO9+V6yUi2PwFc99+Ifn8ZlVZQP26T0ZseuFAmZ2r6ilFThNf09ch+CkVRK8jlTxa z6KW/ZJn0xigIZfkenJSuOIqYD23MlqAgbItRMqL3D7MfrmXnCLrGA/pTVgqkFEa27kV tEVS6g9Dzxng9p66JUZ/X6BM3QhXkBDUy7k3euEINv3Hi/m5PG7iessaih7UFRVXa6Bw GszA== X-Gm-Message-State: AFqh2kq2EwGS2v0CbUU+aVqZ/1FwRjHiUKq3+oJ+CV5AVVVJgzo2lSKQ 8am5kvZY8kZq9U9MoviKB3fUoTh8NejBCA== X-Received: by 2002:a5d:55c7:0:b0:242:5f1f:9d3b with SMTP id i7-20020a5d55c7000000b002425f1f9d3bmr909249wrw.16.1671620077591; Wed, 21 Dec 2022 02:54:37 -0800 (PST) Received: from localhost.localdomain ([37.55.203.63]) by smtp.gmail.com with ESMTPSA id y5-20020a056000108500b0023657e1b980sm15080156wrw.53.2022.12.21.02.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Dec 2022 02:54:37 -0800 (PST) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: Jami Kettunen , Markuss Broks , Jonathan Corbet , Ard Biesheuvel , Greg Kroah-Hartman , Jiri Slaby , Helge Deller , Borislav Petkov , "Paul E. McKenney" , Andrew Morton , Will Deacon , Randy Dunlap , Muchun Song , Damien Le Moal , Kim Phillips , linux-doc@vger.kernel.org, linux-efi@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 1/3] drivers: serial: earlycon: Pass device-tree node Date: Wed, 21 Dec 2022 12:53:58 +0200 Message-Id: <20221221105402.6598-2-markuss.broks@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221221105402.6598-1-markuss.broks@gmail.com> References: <20221221105402.6598-1-markuss.broks@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass a pointer to device-tree node in case the driver probed from OF. This makes early console drivers able to fetch options from device-tree node properties. Signed-off-by: Markuss Broks --- drivers/tty/serial/earlycon.c | 3 +++ include/linux/serial_core.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 4f6e9bf57169..0c7a789d7eb7 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -307,6 +307,9 @@ int __init of_setup_earlycon(const struct earlycon_id *match, strscpy(early_console_dev.options, options, sizeof(early_console_dev.options)); } + + early_console_dev.node = node; + earlycon_init(&early_console_dev, match->name); err = match->setup(&early_console_dev, options); earlycon_print_info(&early_console_dev); diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index fd59f600094a..0b06c0ee7705 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -783,6 +783,7 @@ struct earlycon_device { struct uart_port port; char options[16]; /* e.g., 115200n8 */ unsigned int baud; + unsigned long node; }; struct earlycon_id { -- 2.39.0