Re: [PATCH] console: set default console_device devname

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 08, 2019 at 06:01:11PM -0400, dgienda125@xxxxxxxxx wrote:
> From: David Dgien <dgienda125@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux