diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-01-13 07:11:49 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-13 08:48:59 +0100 |
commit | a1a582f4e0d51311b3a2fac9b7221be4b20fb9de (patch) | |
tree | 4022bd8d5ebd19464cc945bef1cb6f557c0ebc52 | |
parent | 6570288f2d97d3a3dceb3e631b4e4f4305352dc8 (diff) | |
download | barebox-a1a582f4e0d51311b3a2fac9b7221be4b20fb9de.tar.gz barebox-a1a582f4e0d51311b3a2fac9b7221be4b20fb9de.tar.xz |
console: allow to specify the device id
so we can use dynamic number id with specific devname
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/console.c | 2 | ||||
-rw-r--r-- | drivers/serial/serial_imx.c | 4 | ||||
-rw-r--r-- | drivers/usb/gadget/u_serial.c | 1 | ||||
-rw-r--r-- | include/console.h | 1 | ||||
-rw-r--r-- | net/netconsole.c | 1 |
5 files changed, 7 insertions, 2 deletions
diff --git a/common/console.c b/common/console.c index c092621aa1..0c32f06b93 100644 --- a/common/console.c +++ b/common/console.c @@ -194,7 +194,7 @@ int console_register(struct console_device *newcdev) console_init_early(); if (newcdev->devname) { - dev->id = DEVICE_ID_SINGLE; + dev->id = newcdev->devid; strcpy(dev->name, newcdev->devname); } else { dev->id = DEVICE_ID_DYNAMIC; diff --git a/drivers/serial/serial_imx.c b/drivers/serial/serial_imx.c index 21189cbbf8..cd954c282d 100644 --- a/drivers/serial/serial_imx.c +++ b/drivers/serial/serial_imx.c @@ -340,8 +340,10 @@ static int imx_serial_probe(struct device_d *dev) cdev->linux_console_name = "ttymxc"; if (dev->device_node) { devname = of_alias_get(dev->device_node); - if (devname) + if (devname) { cdev->devname = xstrdup(devname); + cdev->devid = DEVICE_ID_SINGLE; + } } imx_serial_init_port(cdev); diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index 8c58746cbd..1e5e8093c0 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -530,6 +530,7 @@ int gserial_connect(struct gserial *gser, u8 port_num) cdev->flush = serial_flush; cdev->setbrg = serial_setbaudrate; cdev->devname = "usbserial"; + cdev->devid = DEVICE_ID_SINGLE; status = console_register(cdev); if (status) diff --git a/include/console.h b/include/console.h index beafb4d778..72b4a440e7 100644 --- a/include/console.h +++ b/include/console.h @@ -47,6 +47,7 @@ struct console_device { int (*set_active)(struct console_device *cdev, unsigned active); char *devname; + int devid; struct list_head list; diff --git a/net/netconsole.c b/net/netconsole.c index 99b998408c..0ee6a7655b 100644 --- a/net/netconsole.c +++ b/net/netconsole.c @@ -154,6 +154,7 @@ static int netconsole_init(void) cdev->putc = nc_putc; cdev->getc = nc_getc; cdev->devname = "netconsole"; + cdev->devid = DEVICE_ID_SINGLE; cdev->set_active = nc_set_active; g_priv = priv; |