mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: dgienda125@gmail.com
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] console: set default console_device devname
Date: Mon, 9 Sep 2019 10:56:23 +0200	[thread overview]
Message-ID: <20190909085623.zjvlscdv4mteamwl@pengutronix.de> (raw)
In-Reply-To: <20190908220111.694-1-dgienda125@gmail.com>

On Sun, Sep 08, 2019 at 06:01:11PM -0400, dgienda125@gmail.com wrote:
> From: David Dgien <dgienda125@gmail.com>
> 
> Some commands (loadb/x/y) rely on console_get_by_name, which searches the list
> of console devices based on console_device->devname. However, some serial
> drivers do not set devname, meaning that their respective console_devices can
> never be found. During console_register, ensure that a default devname is set
> if one is not already explicitly set.
> 
> Signed-off-by: David Dgien <dgienda125@gmail.com>
> ---
>  common/console.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/common/console.c b/common/console.c
> index ee17a508b..dacb6001c 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -324,6 +324,10 @@ int console_register(struct console_device *newcdev)
>  		dev->parent = newcdev->dev;
>  	platform_device_register(dev);
>  
> +	if (!newcdev->devname) {
> +		newcdev->devname = strdup(dev_name(dev));

As the return value is not checked I switched to xstrdup. Applied,
thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2019-09-09  8:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 22:01 dgienda125
2019-09-09  8:56 ` Sascha Hauer [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=20190909085623.zjvlscdv4mteamwl@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=dgienda125@gmail.com \
    /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