Exemple #1
0
static int s3c24xx_serial_initconsole(void)
{
	struct s3c24xx_uart_info *info;
	struct platform_device *dev = s3c24xx_uart_devs[0];

	dbg("s3c24xx_serial_initconsole\n");

	/* select driver based on the cpu */

	if (dev == NULL) {
		printk(KERN_ERR "s3c24xx: no devices for console init\n");
		return 0;
	}

	if (strcmp(dev->name, "s3c2410-uart") == 0) {
		info = s3c2410_uart_inf_at;
	} else if (strcmp(dev->name, "s3c2440-uart") == 0) {
		info = s3c2440_uart_inf_at;
	} else {
		printk(KERN_ERR "s3c24xx: no driver for %s\n", dev->name);
		return 0;
	}

	if (info == NULL) {
		printk(KERN_ERR "s3c24xx: no driver for console\n");
		return 0;
	}

	s3c24xx_serial_console.data = &s3c24xx_uart_drv;
	s3c24xx_serial_init_ports(info);

	register_console(&s3c24xx_serial_console);
	return 0;
}
Exemple #2
0
int s3c24xx_serial_initconsole(struct platform_driver *drv,
                               struct s3c24xx_uart_info *info)

{
    struct platform_device *dev = s3c24xx_uart_devs[0];

    dbg("s3c24xx_serial_initconsole\n");

    /* select driver based on the cpu */

    if (dev == NULL) {
        printk(KERN_ERR "s3c24xx: no devices for console init\n");
        return 0;
    }

    if (strcmp(dev->name, drv->driver.name) != 0)
        return 0;

    s3c24xx_serial_console.data = &s3c24xx_uart_drv;
    s3c24xx_serial_init_ports(info);

    register_console(&s3c24xx_serial_console);
    return 0;
}