9
0
Fork 0

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>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2015-01-13 07:11:49 +01:00 committed by Sascha Hauer
parent 6570288f2d
commit a1a582f4e0
5 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -47,6 +47,7 @@ struct console_device {
int (*set_active)(struct console_device *cdev, unsigned active);
char *devname;
int devid;
struct list_head list;

View File

@ -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;