diff --git a/common/console.c b/common/console.c index c092621aa..0c32f06b9 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 21189cbbf..cd954c282 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 8c58746cb..1e5e8093c 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 beafb4d77..72b4a440e 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 99b998408..0ee6a7655 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;