linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] earlycon: Let users set the clock frequency
Date: Thu, 24 Nov 2022 13:10:10 +0100	[thread overview]
Message-ID: <CANiDSCvq54Xr7OECNuo230XhNbtY1Pgr8GA+ajreEZGYGucq9Q@mail.gmail.com> (raw)
In-Reply-To: <140187ba-7d2c-8b7b-e172-7350eed458be@kernel.org>

On Thu, 24 Nov 2022 at 12:19, Jiri Slaby <jirislaby@kernel.org> wrote:
>
> Hi,
>
> On 24. 11. 22, 11:02, Ricardo Ribalda wrote:
> ...
> > --- a/drivers/tty/serial/earlycon.c
> > +++ b/drivers/tty/serial/earlycon.c
> > @@ -120,9 +120,15 @@ static int __init parse_options(struct earlycon_device *device, char *options)
> >       }
> >
> >       if (options) {
> > +             char *uartclk;
> > +
> >               if (kstrtouint(options, 0, &device->baud) < 0)
> >                       pr_warn("[%s] unsupported earlycon baud rate option\n",
> >                               options);
>
> IMO this won't work if there is a comma in options (i.e. your new
> clkrate param). kstrtouint will return -EINVAL in that case.
>
> > +             uartclk = strchr(options, ',');
> > +             if (uartclk && kstrtouint(uartclk, 0, &port->uartclk) < 0)
>
> You are giving ",number" to kstrtouint, right? That won't work either ;).


The fun thing is that it worked because it fell back to the acpi
parameters :). Will send a v3

Thanks!
>
> regards,
> --
> js
>


-- 
Ricardo Ribalda

      reply	other threads:[~2022-11-24 12:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 10:02 [PATCH v2 0/2] earlycon: Let users set the clock frequency Ricardo Ribalda
2022-11-24 10:02 ` [PATCH v2 1/2] earlycon: Replace simple_strtoul with kstrtouint Ricardo Ribalda
2022-11-24 10:02 ` [PATCH v2 2/2] earlycon: Let users set the clock frequency Ricardo Ribalda
2022-11-24 11:19   ` Jiri Slaby
2022-11-24 12:10     ` Ricardo Ribalda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANiDSCvq54Xr7OECNuo230XhNbtY1Pgr8GA+ajreEZGYGucq9Q@mail.gmail.com \
    --to=ribalda@chromium.org \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).