Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752246AbdHPLwt (ORCPT ); Wed, 16 Aug 2017 07:52:49 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:46184 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbdHPLwr (ORCPT ); Wed, 16 Aug 2017 07:52:47 -0400 From: Eugeniy Paltsev To: "robherring2@gmail.com" CC: "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jslaby@suse.com" , "Eugeniy.Paltsev@synopsys.com" , "gregkh@linuxfoundation.org" , "linux-snps-arc@lists.infradead.org" Subject: Re: [PATCH] earlycon: initialise baud field of earlycon device structure Thread-Topic: [PATCH] earlycon: initialise baud field of earlycon device structure Thread-Index: AQHTFer7YQceFrWdj0yg7U2IcMvyxKKFq2sAgAETjQA= Date: Wed, 16 Aug 2017 11:52:42 +0000 Message-ID: <1502884362.2586.32.camel@synopsys.com> References: <20170815172141.29115-1-Eugeniy.Paltsev@synopsys.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.8.106] Content-Type: text/plain; charset="utf-8" Content-ID: <5F5484911A093147A453EACCC80B0CB6@internal.synopsys.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v7GBqsCd009427 Content-Length: 1945 Lines: 62 Hi Rob, On Tue, 2017-08-15 at 14:26 -0500, Rob Herring wrote: > On Tue, Aug 15, 2017 at 12:21 PM, Eugeniy Paltsev > wrote: > > [snip] > > @@ -282,7 +283,15 @@ int __init of_setup_earlycon(const struct > > earlycon_id *match, > >                 } > >         } > >  > > +       val = of_get_flat_dt_prop(node, "baud", NULL); >  > No, we already have a defined way to set the baud, we don't need a > property in addition. Plus you didn't document it. I guess by defined way to set the baud you mean setting baud after device alias in stdout-path property (like stdout-path = "serial:115200n8"), right? The idea was to reuse "baud" property from serial node to set the earlycon baud: chosen {     ...     stdout-path = &serial; }; serial: uart@... {     ...     baud = <115200>; /* Get baud from here */ }; > > +       if (val) > > +               early_console_dev.baud = be32_to_cpu(*val); > > + > >         if (options) { > > +               err = kstrtoul(options, 10, &baud); > > +               if (!err) > > +                       early_console_dev.baud = baud; >  > This seems fine to do here, but then we should also parse the other > standard options here too. And we should make sure we're not doing it > twice. I added only baud parsing here because we parse only baud from standard options when register_earlycon is used. (see parse_options function which is called from register_earlycon) But I can add other standard options parsing here (probably using uart_parse_options + uart_set_options).  What do you think? > > + > >                 strlcpy(early_console_dev.options, options, > >                         sizeof(early_console_dev.options)); > >         } > > -- > > 2.9.3 --   Eugeniy Paltsev