summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-08-07 06:14:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-08-07 06:14:18 +0200
commit90118343e46fecac78b6351ce25bb610b15fc077 (patch)
tree06f596eedd8fa95c96320a8e185c86a1f33cf5fa
parent3522192d6da091dfae912a28ed9377913b596299 (diff)
parentc053e2414c2a6c2de81cbbc4e49933042613191b (diff)
downloadbarebox-90118343e46fecac78b6351ce25bb610b15fc077.tar.gz
barebox-90118343e46fecac78b6351ce25bb610b15fc077.tar.xz
Merge branch 'for-next/console'
-rw-r--r--common/console.c10
-rw-r--r--drivers/serial/serial_imx.c4
-rw-r--r--drivers/usb/gadget/u_serial.c7
-rw-r--r--include/console.h2
-rw-r--r--net/netconsole.c1
5 files changed, 21 insertions, 3 deletions
diff --git a/common/console.c b/common/console.c
index aa9e3ce0f5..f9823661f0 100644
--- a/common/console.c
+++ b/common/console.c
@@ -170,8 +170,14 @@ int console_register(struct console_device *newcdev)
if (initialized == CONSOLE_UNINITIALIZED)
console_init_early();
- dev->id = DEVICE_ID_DYNAMIC;
- strcpy(dev->name, "cs");
+ if (newcdev->devname) {
+ dev->id = DEVICE_ID_SINGLE;
+ strcpy(dev->name, newcdev->devname);
+ } else {
+ dev->id = DEVICE_ID_DYNAMIC;
+ strcpy(dev->name, "cs");
+ }
+
if (newcdev->dev)
dev->parent = newcdev->dev;
platform_device_register(dev);
diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c
index cb106271d5..474bfafff0 100644
--- a/drivers/serial/serial_imx.c
+++ b/drivers/serial/serial_imx.c
@@ -313,6 +313,7 @@ static int imx_serial_probe(struct device_d *dev)
uint32_t val;
struct imx_serial_devtype_data *devtype;
int ret;
+ const char *devname;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype);
if (ret)
@@ -337,6 +338,9 @@ static int imx_serial_probe(struct device_d *dev)
cdev->flush = imx_serial_flush;
cdev->setbrg = imx_serial_setbaudrate;
cdev->linux_console_name = "ttymxc";
+ devname = of_alias_get(dev->device_node);
+ if (devname)
+ cdev->devname = xstrdup(devname);
imx_serial_init_port(cdev);
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index c2072dc6e9..375ec65141 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -483,7 +483,12 @@ int gserial_connect(struct gserial *gser, u8 port_num)
cdev->getc = serial_getc;
cdev->flush = serial_flush;
cdev->setbrg = serial_setbaudrate;
- console_register(cdev);
+ cdev->devname = "usbserial";
+
+ status = console_register(cdev);
+ if (status)
+ goto fail_out;
+
mycdev = cdev;
return status;
diff --git a/include/console.h b/include/console.h
index 6da0199aba..7535a56121 100644
--- a/include/console.h
+++ b/include/console.h
@@ -44,6 +44,8 @@ struct console_device {
void (*flush)(struct console_device *cdev);
int (*set_mode)(struct console_device *cdev, enum console_mode mode);
+ char *devname;
+
struct list_head list;
unsigned char f_active;
diff --git a/net/netconsole.c b/net/netconsole.c
index 021820b13a..c817107296 100644
--- a/net/netconsole.c
+++ b/net/netconsole.c
@@ -141,6 +141,7 @@ static int netconsole_init(void)
cdev->tstc = nc_tstc;
cdev->putc = nc_putc;
cdev->getc = nc_getc;
+ cdev->devname = "netconsole";
g_priv = priv;