static ssize_t mt_printk_ctrl_write(struct file *filp, const char *ubuf, ssize_t cnt, loff_t *data)
{
	char buf[64];
	int val;
	int ret;
	if (cnt >= sizeof(buf))
		return -EINVAL;

	if (copy_from_user(&buf, ubuf, cnt))
		return -EFAULT;

	buf[cnt] = 0;

	ret = strict_strtoul(buf, 10, (unsigned long *)&val);
	if (val == 0) {
		mt_disable_uart();
	} else if (val == 1) {
		mt_need_uart_console = 1;
		mt_enable_uart();
		pr_err("need uart log\n");
	}
	if (ret < 0)
		return ret;
	pr_err(" %d\n", val);
	return cnt;
}
Esempio n. 2
0
static void bootup_finish(void)
{
    mt_disable_uart();
}