From b330984ac85f9057846b20361dbf083c2d43547c Mon Sep 17 00:00:00 2001 From: David Dgien Date: Sun, 8 Sep 2019 18:01:11 -0400 Subject: console: set default console_device devname 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 Signed-off-by: Sascha Hauer --- common/console.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/console.c') diff --git a/common/console.c b/common/console.c index 3f3a30fc82..d04aae58f9 100644 --- a/common/console.c +++ b/common/console.c @@ -323,6 +323,9 @@ int console_register(struct console_device *newcdev) dev->parent = newcdev->dev; platform_device_register(dev); + if (!newcdev->devname) + newcdev->devname = xstrdup(dev_name(dev)); + newcdev->open_count = 0; /* -- cgit v1.2.3