Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp535347imn; Thu, 28 Jul 2022 08:10:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u531NtIJT9bhjZrRLrsfDMov0r2IObaQa0+KCNlZjaK5KgX3zj5pzVlzluAVrTZckYoXBS X-Received: by 2002:a17:90a:590e:b0:1f2:2184:6893 with SMTP id k14-20020a17090a590e00b001f221846893mr11002634pji.57.1659021058996; Thu, 28 Jul 2022 08:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659021058; cv=none; d=google.com; s=arc-20160816; b=kNuWoxA8jhDiwqfg+PY4K70NlEVVki6dLrbpaMTxKA4KvVSj+EMw0w1yO9yYeCrKvd lLywcO3V6XObdK9oYPn25dtW9iQSwpv9iaB+xv/XseJwP4B8WRHmaOlu+HkMbF4nR7ct +RLqvuZEw4Ir8SDCUuRTjUYnKohGec4qVJQhPM9IW7a+tw3G5p4b+p30R+suowRf0Jqt bpqXvtYow5gK1aPgo7f7jhTDdthJ5wG74R7JynDu1n5rPH+7v+Cp3MAigzJKbDLONUpZ oP3MZOyi0oRkNkTwJ9SKGanr5zr9wlv6aClLIXanijFJMDk41AyS9HFJ5FbCmCMBQ5fk smyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a7UT+j2SoEY5LqXbUcXC4I9hX4avdi0hvES35n3xKR8=; b=UXq+cW5kxWrzwfN2uklnRCK8no1GR63tZAXh36qnZ5DHg0sLx4wygDvPVFDZfK76WL 3Ycf0S6P0VAUbjcZ3J2e/+Vy+HWXXl/szVSuO+iHv4Z2kOjFu0f/MGNRChiXYOBlfNe4 I1JWBKPagNXcsBXpQRd+v4GMfxXBjSL58HmWpT8KzOwywY17FitjqzfA+L/jdw75bYph hPlAUWEXQe4XULXnwR/q19N9ew9nOV05HqKEomlu2ehx42pj0qaqPrcMXfPGNw7ciQk5 Wg5UT/4STiS3ggAXoL23WydmblFWNGuVC0vTGjWsGPrSsmpPtRqR7RgNW7fqHpRq8+pp Fkvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tuZDhK2N; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bn6-20020a056a02030600b0041aff05468asi1120615pgb.4.2022.07.28.08.10.41; Thu, 28 Jul 2022 08:10:58 -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=@linuxfoundation.org header.s=korg header.b=tuZDhK2N; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232677AbiG1OlE (ORCPT + 99 others); Thu, 28 Jul 2022 10:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233329AbiG1Oko (ORCPT ); Thu, 28 Jul 2022 10:40:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6649D6A49B; Thu, 28 Jul 2022 07:38:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 180FEB8248F; Thu, 28 Jul 2022 14:38:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2780FC433C1; Thu, 28 Jul 2022 14:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1659019115; bh=T0SHuXwms0ULhNSk06npqRzjCyjBqf+WMkcyXOh3mVE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tuZDhK2NfIRhsiGsc3OHq9E6APLfmz1ZzviYgdVlFZyC/0qnjX4D+3cSnhMBRDTp/ wf5uKznxn7htR92pkdg7knCkxP9XNNayz9JN/DK3r4/UWNaGNnC+wB6tPHeMLsWWyc wyYxly+6SmnXdxNg9LBc56Hl3Q+lHMH/HtUSJwp8= Date: Thu, 28 Jul 2022 16:38:33 +0200 From: Greg Kroah-Hartman To: Markuss Broks Cc: linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Jonathan Corbet , Ard Biesheuvel , Jiri Slaby , Helge Deller , "Paul E. McKenney" , Borislav Petkov , Andrew Morton , Kees Cook , Randy Dunlap , Damien Le Moal , Thomas Zimmermann , Javier Martinez Canillas , Michal Suchanek , Andy Shevchenko , Arnd Bergmann , 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, Petr Mladek Subject: Re: [PATCH 1/2] drivers: serial: earlycon: Pass device-tree node Message-ID: References: <20220728142824.3836-1-markuss.broks@gmail.com> <20220728142824.3836-2-markuss.broks@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220728142824.3836-2-markuss.broks@gmail.com> X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Thu, Jul 28, 2022 at 05:28:18PM +0300, Markuss Broks wrote: > 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 57c70851f22a0e78805f34d1a7700708104b6f6a..14e8a7fe54486a1c377a6659c37a73858de5bf0b 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.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 cbd5070bc87f42aa450c4ca7af8a9b59fbe88574..3295721f33e482124fae8370b5889d5d6c012303 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; > + unsigned long node; That should not be an unsigned long, but rather an 'int'. Something got messed up, of_setup_earlycon() should be changed to reflect this before propagating the error to other places in the kernel. And it's not really a "node" but an "offset", right? thanks, greg k-h