Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp2969729rwb; Sat, 6 Aug 2022 09:40:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR75uEeonybdBbUeF8IdceWksX27tikRoXZUEv+Jv9dKWXCOiMctd/WxBAJ10b94FiqSAsD0 X-Received: by 2002:a05:6402:378e:b0:43e:73f7:5c53 with SMTP id et14-20020a056402378e00b0043e73f75c53mr11344866edb.124.1659804045086; Sat, 06 Aug 2022 09:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659804045; cv=none; d=google.com; s=arc-20160816; b=ismzMXrkgdG86wTi3kbB+uU4daurCOewvyv9UOrsc9lniFuKkz6ma02+prOdJNDj5m lOUNsMl7ouhqtc6At+kCQQCq6KujgmSPKGtVxMGCLNQ8DdWXja4+vrFaT6hVWeHP5Jcb ldgNQ4E5Qu5oyoNuRGmdcj+a2A1IbP17ymjS239I1XADWQQoxrwduPTEBHS+x4mKGVnW 0q8tXCCNYIISSaUvbwDZlkDTjkAcLg4zdsZn8J3GJ4wjQ+tFl8VF0f1sHXsVOKti02Hr 8mQiFnjYgCyvvP5mDU7zFtgRZM7jscTk4T1aDJ2qYTxQabyxlw/VPAF+HzI87nqz4Axj fMYQ== 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=lQzsDSHH/Bii36GW148CpzzSSa0PYzrLw0cKTC8v8kk=; b=FzTM91B7JRyJia/+qHIJvv+muFpIBc/WdZYHL5wxfIDWGHBuNDOj4kaoa14w6ZfSEy CE2k10Ps8zM7mXLJUJ9uSJF5chcOhpBPWT28ZmzBV8vtP2kPM8hW0c1nlsYe77ShizMU AZyAEcKRZ4iJ4ixjgzZLuQ2clnUsOdewDzqEbRi8X2xs4gvV1PYIYcfJ+cz6FTYOWhjO /n8oa2Qg8QTP/v1WiUOONFUp8rW+7L8KHu8IUmzRSu/1/32F2ysytBuX5/QxyjTJFhR7 rHX9rYZfgTtpElhTcdtLm4v8FnZRpgPfiyc/p25BuySYmZQscF6qBivePSCYraW9mkGs BP/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hFobmJQK; 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 hs5-20020a1709073e8500b0072b3bc0d215si6769330ejc.149.2022.08.06.09.40.19; Sat, 06 Aug 2022 09:40:45 -0700 (PDT) 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=hFobmJQK; 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 S233688AbiHFQeg (ORCPT + 99 others); Sat, 6 Aug 2022 12:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233518AbiHFQef (ORCPT ); Sat, 6 Aug 2022 12:34:35 -0400 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C24E11453; Sat, 6 Aug 2022 09:34:34 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id p9so1489107ilq.13; Sat, 06 Aug 2022 09:34:34 -0700 (PDT) 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; bh=lQzsDSHH/Bii36GW148CpzzSSa0PYzrLw0cKTC8v8kk=; b=hFobmJQK6P0zU3BwVaJVOeRfR8NjKJd0BpCBeJV8Sv60LNy1tvgi4Hk8og/34srU3k eS7VOeHEv8DM21kQAlThdmquREUGhJWZIyHuXcQUhNBP8e3T/jfREWt/ZUs9Sdj+qkhy yjHhdJWbGEyKadKAP6Vj44sBZ1bKbCRmBpgFJQJ08E7tnf8Wpemw7VNHbFdYMJ48ONFC 5Gwj275ZOjz3goTKvLPQeA0Zl8IcMLk4Xyup5NmFma3pkWx1ufB41aMDkMZ6e49PvTqv EMW90DQQTQb8XDvEwxbzO6THMs1tNkoVIUE0GiZ8y8XKZXMdsGRMgftZH9K+eq1QpXK1 assw== 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; bh=lQzsDSHH/Bii36GW148CpzzSSa0PYzrLw0cKTC8v8kk=; b=e+q+P+bD2IeP7bVNGK/pSGjZ06o4dlQb/7/gzPwYEsxDWPXJd5IySPEfSmvJ8c6Q9G CFVWu27YH/cxBCdWWUzjoLXQYNsnesrBhi8hgJTrzSw6mNKlzibvIOxXdbMPmAWeY+WK 1OuFoZJiYwGJ1bTh42lbAgbK7x63IwUBZeNaG5ASKcrpTrlbFOCa9rrqFOHLmcc3VQBk KRmSHacZURgCkgQlrv7rY79XM7BUI5R/dMviwbHtKDiBsN3ZEmH7V4gvXmC8opl2Lik4 rx3NaR5LVIoKqW/BKQuGiLnVUN0VpgyfETa8cfz0FBr6xy6uQp0PC2E+COiH/ZvMzjno 1pWg== X-Gm-Message-State: ACgBeo23WlXlrynw/6nbWbPsjLK9GCVGDRyMo0M0agwPSrOMpUf3UiYA XnEZgWrn1AytWqNLSGXJQRcOh5uOji8r2kwY X-Received: by 2002:a05:6e02:1a81:b0:2de:a8d7:de0c with SMTP id k1-20020a056e021a8100b002dea8d7de0cmr5324479ilv.309.1659803673460; Sat, 06 Aug 2022 09:34:33 -0700 (PDT) Received: from nergzd-desktop.localdomain (tor-exit-50.for-privacy.net. [185.220.101.50]) by smtp.gmail.com with ESMTPSA id a20-20020a056e020e1400b002de6fa0d0c0sm2908009ilk.63.2022.08.06.09.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Aug 2022 09:34:33 -0700 (PDT) From: Markuss Broks To: linux-kernel@vger.kernel.org Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Markuss Broks , Jonathan Corbet , Ard Biesheuvel , Greg Kroah-Hartman , Jiri Slaby , Helge Deller , "Paul E. McKenney" , Borislav Petkov , Kees Cook , Andrew Morton , Randy Dunlap , Damien Le Moal , Thomas Zimmermann , Michal Suchanek , Javier Martinez Canillas , Arnd Bergmann , Maarten Lankhorst , Wei Ming Chen , Bartlomiej Zolnierkiewicz , Tony Lindgren , 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 v2 2/3] drivers: serial: earlycon: Pass device-tree node Date: Sat, 6 Aug 2022 19:32:23 +0300 Message-Id: <20220806163255.10404-3-markuss.broks@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220806163255.10404-1-markuss.broks@gmail.com> References: <20220806163255.10404-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,T_SCC_BODY_TEXT_LINE 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 bc210ae8173d97d5ef422468acf2755a853cb943..be2f01520f6608f6ece725dd83d2526e30477b47 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -304,6 +304,9 @@ int __init of_setup_earlycon(const struct earlycon_id *match, strlcpy(early_console_dev.options, options, sizeof(early_console_dev.options)); } + + early_console_dev.offset = offset; + 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 cbd5070bc87f42aa450c4ca7af8a9b59fbe88574..e65b9aba4e5fdaedb560d2cbbf326a11cfecbcac 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -349,6 +349,7 @@ struct earlycon_device { struct uart_port port; char options[16]; /* e.g., 115200n8 */ unsigned int baud; + int offset; }; struct earlycon_id { -- 2.37.0