LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rob Herring <robherring2@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next 02/12] serial: earlycon: Emit earlycon name in the OF table
Date: Thu, 5 Mar 2015 09:13:58 -0600	[thread overview]
Message-ID: <CAL_Jsq+aj1oWYGLOV4F9c6ZWb79fN56hQiGEZE98+7zHqLX6fg@mail.gmail.com> (raw)
In-Reply-To: <1425489871-22415-3-git-send-email-peter@hurleysoftware.com>

On Wed, Mar 4, 2015 at 11:24 AM, Peter Hurley <peter@hurleysoftware.com> wrote:
> The OF device name of the earlycon is never used because there is no
> device; re-purpose the name field to store the earlycon name in
> the OF earlycon table. Earlycon will use the table entry to
> fixup the console name and index.
>
> Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
> ---
>  include/linux/serial_core.h | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 8aeec49..c523785 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -29,6 +29,7 @@
>  #include <linux/tty.h>
>  #include <linux/mutex.h>
>  #include <linux/sysrq.h>
> +#include <linux/mod_devicetable.h>
>  #include <uapi/linux/serial_core.h>
>
>  #ifdef CONFIG_SERIAL_CORE_CONSOLE
> @@ -353,8 +354,18 @@ extern int of_setup_earlycon(unsigned long addr,
>                  = { .name  = __stringify(_name),                       \
>                      .setup = func  }
>
> -#define OF_EARLYCON_DECLARE(name, compat, fn)                          \
> -       _OF_DECLARE(earlycon, name, compat, fn, void *)

The purpose of this was to follow the same structure for all users of
this. We're not there yet, but this moves in the wrong direction.

> +#ifdef CONFIG_OF
> +#define EARLYCON_OF_TABLE_ATTR __used __section(__earlycon_of_table)
> +#else
> +#define EARLYCON_OF_TABLE_ATTR __attribute__((unused))
> +#endif
> +
> +#define OF_EARLYCON_DECLARE(_name, compat, fn)                         \
> +       static const struct of_device_id __of_table_##_name             \
> +               EARLYCON_OF_TABLE_ATTR                                  \
> +                = { .name = __stringify(_name),                        \

While convenient, this is an abuse of name which is supposed to be the
DT node name.

Perhaps instead of trying to make the earlycon have the right name,
the real console can know the matching earlycon's name?

Rob

> +                    .compatible = compat,                              \
> +                    .data = (fn == (void *)NULL) ? fn : fn  }
>
>  struct uart_port *uart_get_console(struct uart_port *ports, int nr,
>                                    struct console *c);
> --
> 2.3.1
>

  reply	other threads:[~2015-03-05 15:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 17:24 [PATCH -next 00/12] OF earlycon cleanup Peter Hurley
2015-03-04 17:24 ` [PATCH -next 01/12] serial: earlycon: Fixup earlycon console name and index Peter Hurley
2015-03-04 17:24 ` [PATCH -next 02/12] serial: earlycon: Emit earlycon name in the OF table Peter Hurley
2015-03-05 15:13   ` Rob Herring [this message]
2015-03-06 16:05     ` Peter Hurley
2015-03-04 17:24 ` [PATCH -next 03/12] of: earlycon: Fixup earlycon console name and index Peter Hurley
2015-03-04 17:24 ` [PATCH -next 04/12] of: earlycon: Add options string handling Peter Hurley
2015-03-05 16:28   ` Rob Herring
2015-03-04 17:24 ` [PATCH -next 05/12] of: earlycon: Initialize port fields from DT properties Peter Hurley
2015-03-05 16:16   ` Rob Herring
2015-03-04 17:24 ` [PATCH -next 06/12] of: earlycon: Move address translation to of_setup_earlycon() Peter Hurley
2015-03-05 16:25   ` Rob Herring
2015-03-04 17:24 ` [PATCH -next 07/12] serial: earlycon: Common log banner for command line and DT Peter Hurley
2015-03-05 12:02   ` Geert Uytterhoeven
2015-03-05 12:24     ` Peter Hurley
2015-03-04 17:24 ` [PATCH -next 08/12] serial: earlycon: Id the earlycon "driver" in banner Peter Hurley
2015-03-04 17:24 ` [PATCH -next 09/12] of: earlycon: Allow multiple OF_EARLYCON_DECLARE() with same name Peter Hurley
2015-03-04 17:24 ` [PATCH -next 10/12] of: earlycon: Log more helpful message if earlycon not found Peter Hurley
2015-03-04 17:24 ` [PATCH -next 11/12] serial: 8250_early: Use port->regshift Peter Hurley
2015-03-04 17:24 ` [PATCH -next 12/12] serial: 8250_omap: Add omap8250 earlycon Peter Hurley
2015-03-04 17:33 ` [PATCH -next 00/12] OF earlycon cleanup Peter Hurley

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=CAL_Jsq+aj1oWYGLOV4F9c6ZWb79fN56hQiGEZE98+7zHqLX6fg@mail.gmail.com \
    --to=robherring2@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    --cc=robh+dt@kernel.org \
    --subject='Re: [PATCH -next 02/12] serial: earlycon: Emit earlycon name in the OF table' \
    /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

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).